Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
03ef2db
bubbling up errors and fixing tests
mrlunchbox777 Jun 9, 2024
2a18a2b
WIP working on adding io streams
mrlunchbox777 Jun 26, 2024
6af2634
handling nils for the interfaces
mrlunchbox777 Jun 26, 2024
c7b9974
adding a check and test
mrlunchbox777 Jun 26, 2024
01a5eb4
adding some test
mrlunchbox777 Jun 26, 2024
b7284eb
simplifying
mrlunchbox777 Jun 27, 2024
49a78ea
adding and updating some workflows and adding tests
mrlunchbox777 Jun 28, 2024
910b020
Merge remote-tracking branch 'origin' into 180-feature-move-more-scri…
mrlunchbox777 Jun 28, 2024
03f5d74
bumping versions
mrlunchbox777 Jun 28, 2024
3e21ae2
dropping the extra file
mrlunchbox777 Jun 28, 2024
38ac59e
trying to get the workflows to work again
mrlunchbox777 Jun 28, 2024
ab8ad5f
deconflicting the names
mrlunchbox777 Jun 28, 2024
e7a231e
adding the action validator
mrlunchbox777 Jun 28, 2024
b5a3956
updating the action validator
mrlunchbox777 Jun 28, 2024
27ea6e1
poking the checks
mrlunchbox777 Jun 28, 2024
fe84587
more fixes
mrlunchbox777 Jun 28, 2024
d8fcb3f
fixing the ignore
mrlunchbox777 Jun 28, 2024
c199df4
trying something else
mrlunchbox777 Jun 28, 2024
c7f68a7
trying another thing
mrlunchbox777 Jun 28, 2024
6071077
wildcard
mrlunchbox777 Jun 28, 2024
cad37fd
just switching to grep
mrlunchbox777 Jun 28, 2024
504b51d
fixing typo
mrlunchbox777 Jun 28, 2024
f121165
more debug
mrlunchbox777 Jun 28, 2024
64c4e7c
finding more stuff
mrlunchbox777 Jun 28, 2024
8592886
moving back to jobs with steps
mrlunchbox777 Jun 28, 2024
36e6147
bumping and testing more
mrlunchbox777 Jun 28, 2024
8e93a18
fixing the constants test
mrlunchbox777 Jun 28, 2024
18fa856
more test fixes
mrlunchbox777 Jun 28, 2024
03af44e
ensuring that major versions are tested, but not worrying about minor…
mrlunchbox777 Jun 28, 2024
11f286f
renaming and adding the CHANGELOG bump
mrlunchbox777 Jun 28, 2024
ae47176
testing the logs
mrlunchbox777 Jun 28, 2024
fd0d493
tested all of the changelog tested locally and bumping things
mrlunchbox777 Jun 28, 2024
9a4a690
test
mrlunchbox777 Jun 28, 2024
c77cdad
test
mrlunchbox777 Jun 28, 2024
9bb00d5
test
mrlunchbox777 Jun 28, 2024
f43cb6b
test
mrlunchbox777 Jun 28, 2024
b9d308d
test
mrlunchbox777 Jun 28, 2024
d38f559
setting back to a real changelog
mrlunchbox777 Jun 28, 2024
83c97ad
switching back to a failing changelog until this is ready
mrlunchbox777 Jun 28, 2024
0fc3194
attempting the script
mrlunchbox777 Jun 28, 2024
ecdac80
adding execute permissions
mrlunchbox777 Jun 28, 2024
56a3ace
moving scripts to scripts
mrlunchbox777 Jun 28, 2024
67aa265
forgot a folder
mrlunchbox777 Jun 28, 2024
8acad62
forgot the workflows
mrlunchbox777 Jun 28, 2024
4897a07
add execution
mrlunchbox777 Jun 28, 2024
b745263
lysdexia
mrlunchbox777 Jun 28, 2024
0452c37
adding test to factory
mrlunchbox777 Jun 29, 2024
bbaf1ef
found WIP
mrlunchbox777 Jun 26, 2025
8413967
Merge branch 'main' into 180-feature-move-more-scripts-to-golang
mrlunchbox777 Jun 26, 2025
2927bcb
bbctl moved, adjusting, currently broken
mrlunchbox777 Jun 26, 2025
e017491
still broken, but got main test working
mrlunchbox777 Jun 27, 2025
418e200
fixing the rest of the tests
mrlunchbox777 Jun 28, 2025
2d9cb4e
Merge branch 'main' into 180-feature-move-more-scripts-to-golang
mrlunchbox777 Jun 28, 2025
a34ca08
docs bump
mrlunchbox777 Jun 28, 2025
813c6bb
trying to fix the pipe
mrlunchbox777 Jun 28, 2025
aad30d3
trying again
mrlunchbox777 Jun 28, 2025
cf0a1a0
Update shared-scripts/big-bang/readme-bump.sh
mrlunchbox777 Jun 28, 2025
1296cf5
Merge branch 'main' into 180-feature-move-more-scripts-to-golang
mrlunchbox777 Oct 3, 2025
484155b
Merge branch '180-feature-move-more-scripts-to-golang' of github.com:…
mrlunchbox777 Oct 3, 2025
9aa95ff
feat: updating gitalias
mrlunchbox777 Oct 3, 2025
e260b75
Merge branch 'main' into 180-feature-move-more-scripts-to-golang
mrlunchbox777 Oct 3, 2025
4ed3b8c
Merge branch 'main' into 180-feature-move-more-scripts-to-golang
mrlunchbox777 Jan 16, 2026
001b75a
feat: finishing this pr so more can be done
mrlunchbox777 Jan 16, 2026
9854e8a
fix: update CHANGELOG and version to 0.1.3 for test fixes
mrlunchbox777 Jan 16, 2026
db85c57
chore: apply code review feedback - improve bash idioms and Go naming…
Copilot Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/action-validator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Action Validator

on:
push:
paths:
- ".github/workflows/action-validator.yaml"
branches:
- main
pull_request:
branches:
- main

defaults:
run:
shell: bash

jobs:
check_actions:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install action-validator with asdf
uses: asdf-vm/actions/install@v3
with:
tool_versions: |
action-validator 0.5.1

- name: Lint Actions
run: ./bsctl/scripts/workflows/action-validator_check-actions_lint-actions.sh
File renamed without changes.
25 changes: 25 additions & 0 deletions .github/workflows/docs-bump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docs Bump

# We do not want to trigger the workflow for pushes to *any* branch because this
# would trigger our jobs twice on pull requests (once from "push" event and once
# from "pull_request->synchronize")
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- 'main'

jobs:
docs_bump:
name: "Docs Bump"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Version Bump
run: ./bsctl/scripts/workflows/docs-bump_docs-bump_version-bump.sh

- name: CHANGELOG Bump
run: ./bsctl/scripts/workflows/docs-bump_docs-bump_CHANGELOG-bump.sh
14 changes: 10 additions & 4 deletions .github/workflows/go-coverage-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ jobs:
with:
go-version: ^1.22

# When you execute your unit tests, make sure to use the "-coverprofile" flag to write a
# coverage profile to a file. You will need the name of the file (e.g. "coverage.txt")
# in the next step as well as the next job.
- name: Build Go project
run: |
cd bsctl
go build -v -o bsctl
echo "$PWD" >> $GITHUB_PATH

- name: pwd
run: pwd && ls -laf

# When you execute your unit tests, make sure to use the "-coverprofile" flag to write a
# coverage profile to a file. You will need the name of the file (e.g. "coverage.txt")
# in the next step as well as the next job.
- name: Test
run: |
cd bsctl
Expand All @@ -47,7 +53,6 @@ jobs:
with:
name: code-coverage
path: bsctl/coverage.txt # Make sure to use the same file name you chose for the "-coverprofile" in the "Test" step

code_coverage:
name: "Code coverage report"
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
Expand All @@ -63,6 +68,7 @@ jobs:
with:
coverage-artifact-name: "code-coverage" # can be omitted if you used this default value
coverage-file-name: "coverage.txt" # can be omitted if you used this default value

- name: Archive file changes
uses: actions/upload-artifact@v6
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ install/minikube*
!/shared-scripts/big-bang/bin/.gitkeep
bin/
coverage.txt
coverage.out
1 change: 0 additions & 1 deletion .gitkeep

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---
## [0.1.3] - 2026-01-16
### Fixed
- Updated test expectations after bbctl v1.5.0 upgrade - error messages changed from "FakeWriter intentionally errored" to "FakeReader intentionally errored"
- Updated go.mod dependencies via go mod tidy

## [0.1.2] - 2025-06-27
### Added
- Added `ReaderTee` and `WriterTee` to `bsctl/util/k8s/io_streams_tees.go` to allow reading from and writing to multiple streams simultaneously.

## [0.1.1] - 2024-06-28
### Added
- Added unit tests for `ReaderTee` and `WriterTee` in `bsctl/util/k8s/io_streams_tees_test.go`.

## [0.1.0] - 2024-04-11
### Added
- create MVP
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ test:
cd ./bsctl; make test

vet:
cd ./bsctl; vet
cd ./bsctl; make vet
2 changes: 1 addition & 1 deletion bsctl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ bsctl is the golang part of the project that will eventually hold most of the lo
## Other Projects
As an orchestrator bsctl relies heavily on external projects. When imported, they may or may not be specifically credited below; however, when code snippets are used, as much as possible, in no particular order, they will be listed with a link to their license below. Please report all missing attributions in an [issue](https://github.com/mrlunchbox777/basic-setup/issues/new?template=attribution.yaml)).

- [bbctl](https://repo1.dso.mil/big-bang/product/packages/bbctl) - [Apache 2.0 License](https://repo1.dso.mil/big-bang/product/packages/bbctl/-/blob/main/LICENSE)
- [bbctl](https://repo1.dso.mil/big-bang/apps/developer-tools/bbctl) - [Apache 2.0 License](https://repo1.dso.mil/big-bang/apps/developer-tools/bbctl/-/blob/main/LICENSE)
11 changes: 5 additions & 6 deletions bsctl/cmd/basic_setup/add_general_rc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"

"github.com/spf13/cobra"
genericIOOptions "k8s.io/cli-runtime/pkg/genericiooptions"
cmdUtil "k8s.io/kubectl/pkg/cmd/util"
"k8s.io/kubectl/pkg/util/i18n"
"k8s.io/kubectl/pkg/util/templates"

Expand All @@ -26,15 +24,16 @@ var (
)

// NewAddGeneralRcCmd - new add-general-rc command
func NewAddGeneralRcCmd(factory bsUtil.Factory, streams genericIOOptions.IOStreams) *cobra.Command {
func NewAddGeneralRcCmd(factory bsUtil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: addGeneralRcUse,
Short: addGeneralRcShort,
Long: addGeneralRcLong,
Example: addGeneralRcExample,
Run: func(cmd *cobra.Command, args []string) {
_, err := streams.Out.Write([]byte(fmt.Sprintln("Please provide a subcommand for basic-setup (see help)")))
cmdUtil.CheckErr(err)
RunE: func(cmd *cobra.Command, args []string) error {
streams := factory.GetStreams()
_, err := streams.Out().Write([]byte(fmt.Sprintln("Please provide a subcommand for basic-setup (see help)")))
return err
},
}

Expand Down
36 changes: 36 additions & 0 deletions bsctl/cmd/basic_setup/add_general_rc_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package basic_setup

import (
"bytes"
"testing"

bbTestUtil "github.com/mrlunchbox777/basic-setup/bsctl/util/test"
"github.com/stretchr/testify/assert"
)

func TestNewAddGeneralRcCmd(t *testing.T) {
// Arrange
factory := bbTestUtil.GetFakeFactory()
// Act
cmd := NewAddGeneralRcCmd(factory)
// Assert
assert.NotNil(t, cmd)
assert.Equal(t, "add-general-rc", cmd.Use)
assert.Equal(t, 0, len(cmd.Commands()))
}

func TestNewAddGeneralRcCmdRunE(t *testing.T) {
// Arrange
factory := bbTestUtil.GetFakeFactory()
streams := factory.GetStreams()
cmd := NewAddGeneralRcCmd(factory)
// Act
err := cmd.RunE(cmd, []string{})
// Assert
assert.NotNil(t, cmd)
assert.NoError(t, err)
assert.Equal(t, "add-general-rc", cmd.Use)
assert.Equal(t, "Please provide a subcommand for basic-setup (see help)\n", streams.Out().(*bytes.Buffer).String())
assert.Equal(t, "", streams.ErrOut().(*bytes.Buffer).String())
assert.Equal(t, "", streams.In().(*bytes.Buffer).String())
}
13 changes: 6 additions & 7 deletions bsctl/cmd/basic_setup/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"

"github.com/spf13/cobra"
genericIOOptions "k8s.io/cli-runtime/pkg/genericiooptions"
cmdUtil "k8s.io/kubectl/pkg/cmd/util"
"k8s.io/kubectl/pkg/util/i18n"
"k8s.io/kubectl/pkg/util/templates"

Expand All @@ -26,19 +24,20 @@ var (
)

// NewBasicSetupCmd - new basic-setup command
func NewBasicSetupCmd(factory bsUtil.Factory, streams genericIOOptions.IOStreams) *cobra.Command {
func NewBasicSetupCmd(factory bsUtil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: rootUse,
Short: rootShort,
Long: rootLong,
Example: rootExample,
Run: func(cmd *cobra.Command, args []string) {
_, err := streams.Out.Write([]byte(fmt.Sprintln("Please provide a subcommand for basic-setup (see help)")))
cmdUtil.CheckErr(err)
RunE: func(cmd *cobra.Command, args []string) error {
streams := factory.GetStreams()
_, err := streams.Out().Write([]byte(fmt.Sprintln("Please provide a subcommand for basic-setup (see help)")))
return err
},
}

cmd.AddCommand(NewAddGeneralRcCmd(factory, streams))
cmd.AddCommand(NewAddGeneralRcCmd(factory))

return cmd
}
18 changes: 10 additions & 8 deletions bsctl/cmd/basic_setup/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ import (
"testing"

"github.com/stretchr/testify/assert"
genericIOOptions "k8s.io/cli-runtime/pkg/genericiooptions"

bbTestUtil "github.com/mrlunchbox777/basic-setup/bsctl/util/test"
)

func TestBasicSetup_RootUsage(t *testing.T) {
// Arrange
streams, _, _, _ := genericIOOptions.NewTestIOStreams()
factory := bbTestUtil.GetFakeFactory()
// Act
cmd := NewBasicSetupCmd(factory, streams)
cmd := NewBasicSetupCmd(factory)
// Assert
assert.NotNil(t, cmd)
assert.Equal(t, "basic-setup", cmd.Use)
Expand All @@ -29,13 +27,17 @@ func TestBasicSetup_RootUsage(t *testing.T) {

func TestK3d_RootNoSubcommand(t *testing.T) {
// Arrange
streams, in, out, errout := genericIOOptions.NewTestIOStreams()
factory := bbTestUtil.GetFakeFactory()
store := factory.GetStreamsGetter().GetStreamStores()
// Act
cmd := NewBasicSetupCmd(factory, streams)
cmd := NewBasicSetupCmd(factory)
// Assert
assert.Nil(t, cmd.Execute())
assert.Empty(t, in.String())
assert.Empty(t, errout.String())
assert.Contains(t, out.String(), "Please provide a subcommand for basic-setup (see help)")
assert.Empty(t, store.In.String())
assert.Empty(t, store.ErrOut.String())
assert.Contains(t, store.Out.String(), "Please provide a subcommand for basic-setup (see help)")
assert.Equal(t, 3, len(cmd.Commands()))
assert.Equal(t, "add-general-rc", cmd.Commands()[0].Use)
assert.Equal(t, "completion", cmd.Commands()[1].Use)
assert.Equal(t, "help [command]", cmd.Commands()[2].Use)
}
9 changes: 4 additions & 5 deletions bsctl/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cmd
import (
bsHelp "github.com/mrlunchbox777/basic-setup/bsctl/cmd/help"
"github.com/spf13/cobra"
genericIOOptions "k8s.io/cli-runtime/pkg/genericiooptions"
"k8s.io/kubectl/pkg/util/i18n"
"k8s.io/kubectl/pkg/util/templates"

Expand All @@ -26,7 +25,7 @@ var (
)

// NewRootCmd - create a new Cobra root command
func NewRootCmd(factory bsUtil.Factory, streams genericIOOptions.IOStreams) *cobra.Command {
func NewRootCmd(factory bsUtil.Factory) *cobra.Command {

cmd := &cobra.Command{
Use: cmdUse,
Expand All @@ -39,10 +38,10 @@ func NewRootCmd(factory bsUtil.Factory, streams genericIOOptions.IOStreams) *cob
cmd.CompletionOptions.DisableNoDescFlag = true
cmd.CompletionOptions.DisableDescriptions = false

cmd.AddCommand(NewCompletionCmd(factory, streams))
cmd.AddCommand(NewVersionCmd(factory, streams))
cmd.AddCommand(NewCompletionCmd(factory))
cmd.AddCommand(NewVersionCmd(factory))

cmd.AddCommand(basic_setup.NewBasicSetupCmd(factory, streams))
cmd.AddCommand(basic_setup.NewBasicSetupCmd(factory))

addHelpCommandsRecursively(cmd, false)

Expand Down
17 changes: 7 additions & 10 deletions bsctl/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ import (

"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
genericIOOptions "k8s.io/cli-runtime/pkg/genericiooptions"

bbTestUtil "github.com/mrlunchbox777/basic-setup/bsctl/util/test"
)

func TestCmd_RootUsage(t *testing.T) {
// Arrange
streams, _, _, _ := genericIOOptions.NewTestIOStreams()
factory := bbTestUtil.GetFakeFactory()
// Act
cmd := NewRootCmd(factory, streams)
cmd := NewRootCmd(factory)
// Assert
assert.NotNil(t, cmd)
assert.Equal(t, "bsctl", cmd.Use)
Expand All @@ -32,15 +30,15 @@ func TestCmd_RootUsage(t *testing.T) {

func Test_RootNoSubcommand(t *testing.T) {
// Arrange
streams, in, out, errout := genericIOOptions.NewTestIOStreams()
factory := bbTestUtil.GetFakeFactory()
store := factory.GetStreamsGetter().GetStreamStores()
// Act
cmd := NewRootCmd(factory, streams)
cmd := NewRootCmd(factory)
// Assert
assert.Nil(t, cmd.Execute())
assert.Empty(t, in.String())
assert.Empty(t, errout.String())
assert.Empty(t, out.String())
assert.Empty(t, store.In.String())
assert.Empty(t, store.ErrOut.String())
assert.Empty(t, store.Out.String())
}

func testAllSubCommands(t *testing.T, rootCommand *cobra.Command) {
Expand All @@ -53,10 +51,9 @@ func testAllSubCommands(t *testing.T, rootCommand *cobra.Command) {

func Test_AllCommandsHaveUseNames(t *testing.T) {
// Arrange
streams, _, _, _ := genericIOOptions.NewTestIOStreams()
factory := bbTestUtil.GetFakeFactory()
// Act
cmd := NewRootCmd(factory, streams)
cmd := NewRootCmd(factory)
// Assert
assert.NotEmpty(t, cmd.Use)
testAllSubCommands(t, cmd)
Expand Down
Loading
Loading