-
-
Notifications
You must be signed in to change notification settings - Fork 1
Introduces subcommands, POSIX compliance, and detailed error messages, improving user experience #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nataliagranato
wants to merge
16
commits into
main
Choose a base branch
from
develop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Introduces subcommands, POSIX compliance, and detailed error messages, improving user experience #39
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4080367
Adicionar suporte completo a auto-completion para bash, zsh, fish e P…
Copilot 8efe5fe
Initial plan (#32)
Copilot 6a06bd5
Initial plan (#33)
Copilot 094a967
[WIP] feat(cli): adicionar suporte para subcomandos na CLI (#34)
Copilot 29da9eb
Implementar testes unitários abrangentes para kubeprobes (#36)
Copilot f89a995
Improve CLI error messages and help text for better user experience (…
Copilot 4388b35
Implement POSIX-compliant CLI with comprehensive tests and documentat…
Copilot 1a67a9a
feat: enhance Docker support with KUBECONFIG environment variable exa…
Copilot 7f4e0ff
Update internal/scanner/scanner.go
nataliagranato 0306940
Update .github/workflows/ci.yml
nataliagranato 0d9cd2c
Update .github/workflows/ci.yml
nataliagranato b787abd
Update internal/cli/version_test.go
nataliagranato 437f882
Update internal/scanner/scanner.go
nataliagranato 8b4a104
Update .github/workflows/ci.yml
nataliagranato 8575c18
Melhora a eficiência do Dockerfile ao copiar arquivos go.mod e go.sum…
nataliagranato 73d84af
Atualiza o template de plataforma e data no arquivo .goreleaser.yml p…
nataliagranato File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| go-version: [1.23, 1.24] | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ${{ matrix.go-version }} | ||
|
|
||
| - name: Cache Go modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cache/go-build | ||
| ~/go/pkg/mod | ||
| key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-go-${{ matrix.go-version }}- | ||
| ${{ runner.os }}-go- | ||
| - name: Download dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Verify dependencies | ||
| run: go mod verify | ||
|
|
||
| - name: Run tests | ||
| run: go test -race -coverprofile=coverage.out ./... | ||
|
|
||
| - name: Generate coverage report | ||
| run: go tool cover -html=coverage.out -o=coverage.html | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| if: matrix.go-version == '1.24' | ||
nataliagranato marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| with: | ||
| file: ./coverage.out | ||
| fail_ci_if_error: false | ||
|
|
||
| - name: Check coverage threshold | ||
| if: matrix.go-version == '1.24' | ||
| run: | | ||
| COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//') | ||
| echo "Total coverage: $COVERAGE%" | ||
| if (( $(echo "$COVERAGE < 75" | bc -l) )); then | ||
| echo "Error: Coverage $COVERAGE% is below required threshold of 75%" | ||
nataliagranato marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| exit 1 | ||
| fi | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.24 | ||
|
|
||
| - name: Run golangci-lint | ||
| uses: golangci/golangci-lint-action@v6 | ||
| with: | ||
| version: latest | ||
| args: --timeout=5m | ||
|
|
||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| goos: [linux, darwin, windows] | ||
| goarch: [amd64, arm64] | ||
| exclude: | ||
| - goos: windows | ||
| goarch: arm64 | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.24 | ||
|
|
||
| - name: Build binary | ||
| env: | ||
| GOOS: ${{ matrix.goos }} | ||
| GOARCH: ${{ matrix.goarch }} | ||
| run: | | ||
| if [ "$GOOS" = "windows" ]; then | ||
| go build -o kubeprobes-${{ matrix.goos }}-${{ matrix.goarch }}.exe ./cmd/kubeprobes | ||
| else | ||
| go build -o kubeprobes-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/kubeprobes | ||
| fi | ||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: kubeprobes-${{ matrix.goos }}-${{ matrix.goarch }} | ||
| path: kubeprobes-* | ||
|
|
||
| security: | ||
| name: Security Scan | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.24 | ||
|
|
||
| - name: Run govulncheck | ||
| run: | | ||
| go install golang.org/x/vuln/cmd/govulncheck@latest | ||
| govulncheck ./... | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.