Skip to content

Fix/requests sample config#33

Merged
xenOs76 merged 4 commits into
mainfrom
fix/requests_sample_config
May 18, 2026
Merged

Fix/requests sample config#33
xenOs76 merged 4 commits into
mainfrom
fix/requests_sample_config

Conversation

@xenOs76
Copy link
Copy Markdown
Owner

@xenOs76 xenOs76 commented May 18, 2026

Summary by CodeRabbit

  • Documentation
    • Updated jwtinfo command help text to display a concrete OIDC provider JWKS discovery URL example instead of a generic placeholder.

Review Change Stack

@xenOs76 xenOs76 self-assigned this May 18, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@xenOs76 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 10 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0375b590-f9ef-4a55-b1ca-904ca32cc7f3

📥 Commits

Reviewing files that changed from the base of the PR and between 2f5bb8b and d2b8150.

📒 Files selected for processing (1)
  • internal/cmd/root_test.go
📝 Walkthrough

Walkthrough

This PR refactors how the requests command outputs sample configuration, adds test coverage for that output path, improves documentation with concrete examples, promotes a transitive dependency to direct, and stabilizes a test fixture by properly managing command argument state.

Changes

Output handling, documentation, and test improvements

Layer / File(s) Summary
Requests command output refactoring
internal/cmd/requests.go, internal/cmd/requests_test.go
Requests imports fmt and switches sample config output to fmt.Fprint(cmd.OutOrStdout(), ...), with new test TestRequestsCmd_ShowSampleConfigStdout verifying stdout contains expected config and stderr remains empty.
Documentation and dependency updates
internal/cmd/jwtinfo.go, go.mod
Jwtinfo help text shows a real OIDC discovery JWKS URL example (https://.../.well-known/openid-configuration) instead of a generic placeholder. Pflag is moved from indirect to direct dependency in the main require block.
Root command test fixture stabilization
internal/cmd/root_test.go
"Execute empty config" subtest now explicitly sets rootCmd args to ["--config"] and restores to nil in cleanup, ensuring reliable triggering of the missing-argument error.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A config flows clearer through stdout today,
With examples that point the right way,
Dependencies sorted and tests standing tall,
Each fixture now stable—no failures at all! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix/requests sample config' is directly related to the main change: fixing the requests command's --show-sample-config output to use fmt.Fprint instead of cmd.Print, plus supporting test updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/requests_sample_config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/cmd/jwtinfo.go`:
- Line 73: Update the example value for VALIDATION_URL in
internal/cmd/jwtinfo.go to fix the typo "oicd-sample-id" -> "oidc-sample-id" so
the user-facing help text shows the correct OIDC path; locate the constant or
example assignment referencing VALIDATION_URL and replace the misspelled segment
while preserving the rest of the URL string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e0b6e286-692d-49f4-89e5-bd19f801d18e

📥 Commits

Reviewing files that changed from the base of the PR and between f13e05d and 2f5bb8b.

⛔ Files ignored due to path filters (1)
  • devenv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • go.mod
  • internal/cmd/jwtinfo.go
  • internal/cmd/requests.go
  • internal/cmd/requests_test.go
  • internal/cmd/root_test.go

Comment thread internal/cmd/jwtinfo.go
export REQ_URL="https://sample.provider/oauth/token"
export REQ_VALUES="{\"login\":\"values\"}"
export VALIDATION_URL="https://url.to/jwks.json"
export VALIDATION_URL="https://oidc.sample.url/oicd-sample-id/.well-known/jwks.json"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix typo in the VALIDATION_URL example.

Line 73 uses oicd-sample-id, which looks like a typo (oidc-sample-id) in user-facing help text.

Suggested patch
-  export VALIDATION_URL="https://oidc.sample.url/oicd-sample-id/.well-known/jwks.json"
+  export VALIDATION_URL="https://oidc.sample.url/oidc-sample-id/.well-known/jwks.json"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export VALIDATION_URL="https://oidc.sample.url/oicd-sample-id/.well-known/jwks.json"
export VALIDATION_URL="https://oidc.sample.url/oidc-sample-id/.well-known/jwks.json"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cmd/jwtinfo.go` at line 73, Update the example value for
VALIDATION_URL in internal/cmd/jwtinfo.go to fix the typo "oicd-sample-id" ->
"oidc-sample-id" so the user-facing help text shows the correct OIDC path;
locate the constant or example assignment referencing VALIDATION_URL and replace
the misspelled segment while preserving the rest of the URL string.

@xenOs76 xenOs76 merged commit ff7a3bb into main May 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant