Skip to content
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

fix(commands): build-info too verbose #7128

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

james-d-elliott
Copy link
Member

This fixes an issue where the build-info command is too verbose.

@authelia
Copy link

authelia bot commented Apr 10, 2024

Artifacts

These changes are published for testing on Buildkite, DockerHub and GitHub Container Registry.

Docker Container

  • docker pull authelia/authelia:fix-build-info-verbosity
  • docker pull ghcr.io/authelia/authelia:fix-build-info-verbosity

Copy link
Contributor

coderabbitai bot commented Apr 10, 2024

Walkthrough

The recent updates aim to enhance build information output and version management across various files. The introduction of the "verbose" flag in the build-info command enables detailed output during builds. The BuildInfoRunE function now provides more comprehensive build details. Additionally, restructuring in const.go improves formatting and includes additional fields for Go version information.

Changes

File Path Change Summary
internal/commands/.../build-info.go Added "verbose" flag for detailed output; updated BuildInfoRunE function to handle this and include more build details.
internal/commands/.../const.go Updated fmtAutheliaBuildGo constant to improve formatting and include Go version information.
cmd/authelia-scripts/cmd/gen.go Updated Swagger UI version from "5.13.0" to "5.15.0" in cmd/gen.go.
docs/content/integration/openid-connect/homarr/index.md,
docs/content/integration/openid-connect/nextcloud/index.md
Updated dates in index.md files.
docs/content/reference/cli/authelia/authelia_build-info.md Added -v, --verbose option to authelia build-info command for verbose output.
internal/suites/suite_cli_test.go Extended regular expression r to include more build information; updated test assertions accordingly.

Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2bd63fa and 62fd2e1.
Files selected for processing (7)
  • cmd/authelia-scripts/cmd/gen.go (1 hunks)
  • docs/content/integration/openid-connect/homarr/index.md (1 hunks)
  • docs/content/integration/openid-connect/nextcloud/index.md (1 hunks)
  • docs/content/reference/cli/authelia/authelia_build-info.md (1 hunks)
  • internal/commands/build-info.go (2 hunks)
  • internal/commands/const.go (1 hunks)
  • internal/suites/suite_cli_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • internal/commands/build-info.go
  • internal/commands/const.go
  • internal/suites/suite_cli_test.go
Additional comments not posted (4)
cmd/authelia-scripts/cmd/gen.go (1)

10-10: Update to Swagger UI version "5.15.0" looks good. Ensure compatibility with existing functionalities.

Verification successful

The update from Swagger UI version "5.13.0" to "5.15.0" includes several bug fixes and minor feature enhancements. There are no breaking changes noted in the release notes, indicating that the update should be compatible with existing functionalities.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for any breaking changes or major updates in Swagger UI between versions 5.13.0 and 5.15.0
curl -s https://github.com/swagger-api/swagger-ui/releases | grep -E '5\.13\.0|5\.15\.0'

Length of output: 2333



Script:

#!/bin/bash
# Fetch and display the release notes for Swagger UI versions 5.13.0 to 5.15.0
curl -s https://github.com/swagger-api/swagger-ui/compare/v5.13.0...v5.15.0

Length of output: 174062



Script:

#!/bin/bash
# Attempt to fetch release notes directly from the Swagger UI GitHub repository for versions 5.13.0 and 5.15.0
curl -s https://api.github.com/repos/swagger-api/swagger-ui/releases/tags/v5.15.0
curl -s https://api.github.com/repos/swagger-api/swagger-ui/releases/tags/v5.13.0

Length of output: 6771

docs/content/reference/cli/authelia/authelia_build-info.md (1)

47-48: Documentation for the -v, --verbose option is clear and correctly formatted.

docs/content/integration/openid-connect/homarr/index.md (1)

5-5: Date update to 2022-06-15 in the Homarr integration documentation is appropriate.

docs/content/integration/openid-connect/nextcloud/index.md (1)

5-5: Date update to 2022-06-15T17:51:47+10:00 in the Nextcloud integration documentation is correct.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@james-d-elliott james-d-elliott force-pushed the fix-build-info-verbosity branch 2 times, most recently from 1d99b9b to 2394309 Compare April 10, 2024 09:38
Copy link

netlify bot commented Apr 10, 2024

Deploy Preview for authelia-staging ready!

Name Link
🔨 Latest commit 2394309
🔍 Latest deploy log https://app.netlify.com/sites/authelia-staging/deploys/66165dfe67e6f800088e6ec9
😎 Deploy Preview https://deploy-preview-7128--authelia-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

}
}

_, err = fmt.Printf(fmtAutheliaBuild, utils.BuildTag, utils.BuildState, utils.BuildBranch, utils.BuildCommit,
utils.BuildNumber, runtime.GOOS, runtime.GOARCH, runtime.Compiler, utils.BuildDate, utils.BuildExtra, b.String())
fmt.Printf(b.String())
Copy link
Collaborator

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)

@james-d-elliott james-d-elliott force-pushed the fix-build-info-verbosity branch 2 times, most recently from 317dc61 to e4a71cc Compare April 10, 2024 10:21
Copy link
Contributor

@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

}
}

_, err = fmt.Printf(fmtAutheliaBuild, utils.BuildTag, utils.BuildState, utils.BuildBranch, utils.BuildCommit,
utils.BuildNumber, runtime.GOOS, runtime.GOARCH, runtime.Compiler, utils.BuildDate, utils.BuildExtra, b.String())
fmt.Printf(b.String())
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace fmt.Printf with fmt.Print to avoid unnecessary formatting since no formatting arguments are provided.

- fmt.Printf(b.String())
+ fmt.Print(b.String())

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.

Suggested change
fmt.Printf(b.String())
fmt.Print(b.String())

This fixes an issue where the build-info command is too verbose.

Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.69%. Comparing base (2bd63fa) to head (62fd2e1).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7128      +/-   ##
==========================================
+ Coverage   73.63%   73.69%   +0.05%     
==========================================
  Files         344      344              
  Lines       29930    29937       +7     
  Branches      839      839              
==========================================
+ Hits        22039    22062      +23     
+ Misses       7019     7008      -11     
+ Partials      872      867       -5     
Flag Coverage Δ
backend 74.60% <100.00%> (+0.06%) ⬆️
frontend 65.74% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
internal/commands/build-info.go 93.87% <100.00%> (+1.02%) ⬆️

... and 9 files with indirect coverage changes

@james-d-elliott james-d-elliott merged commit 93fe754 into master Apr 10, 2024
49 checks passed
@james-d-elliott james-d-elliott deleted the fix-build-info-verbosity branch April 10, 2024 11:34
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.

None yet

2 participants