Skip to content

[ci] Fix checkout and improve error output for gen_versions_map.sh - #845

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix-escaping-ver-gen
Apr 22, 2025
Merged

[ci] Fix checkout and improve error output for gen_versions_map.sh#845
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix-escaping-ver-gen

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Apr 22, 2025

Copy link
Copy Markdown
Member

Third attempt to fix #842 and #836

tested in https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808

Signed-off-by: Andrei Kvapil kvapss@gmail.com

Summary by CodeRabbit

  • Chores
    • Improved GitHub Actions workflow to fetch full git history and tags during pre-commit checks.
  • Refactor
    • Updated script behavior to display error messages when version extraction from git fails, making troubleshooting easier.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai

coderabbitai Bot commented Apr 22, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This update modifies two components: the GitHub Actions workflow for pre-commit checks and the hack/gen_versions_map.sh script. The workflow now fetches the full git history and all tags during the checkout step. In the shell script, error suppression is removed from certain git show commands, allowing errors to be visible in the output. No changes were made to the logic or public interfaces of either component.

Changes

File(s) Change Summary
.github/workflows/pre-commit.yml Modified the checkout step to use fetch-depth: 0 and fetch-tags: true for complete git data.
hack/gen_versions_map.sh Removed 2>/dev/null error suppression from git show commands, allowing errors to be shown.

Possibly related PRs

Suggested labels

ok-to-test

Suggested reviewers

  • lllamnyp
  • klinch0

Poem

A bunny hopped through scripts and logs,
Removing mutes from error bogs.
With tags and history fetched anew,
The garden’s workflow clearer grew.
Now every hiccup, loud and bright,
Helps coders fix things left and right!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
hack/gen_versions_map.sh (1)

34-35: DRY up duplicate version‐extraction logic
Both the commit‐ and tag‐lookup blocks use identical git show … | awk pipelines. Consider extracting this into a helper function (e.g. get_chart_version ref chart) to reduce code duplication and improve maintainability.

Also applies to: 47-48

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e505857 and 39ede77.

📒 Files selected for processing (2)
  • .github/workflows/pre-commit.yml (1 hunks)
  • hack/gen_versions_map.sh (2 hunks)
🔇 Additional comments (3)
hack/gen_versions_map.sh (2)

34-34: Expose git show errors by removing stderr suppression
Removing 2>/dev/null ensures that failures in git show (e.g., missing commit or file) will be visible, improving debuggability in CI.


47-47: Expose tag lookup errors for better diagnostics
Now that git show on tags emits errors instead of being silenced, you'll get immediate feedback if a chart version isn't present at a given tag.

.github/workflows/pre-commit.yml (1)

16-18: Checkout full history and all tags for version‐mapping script
Adding fetch-depth: 0 and fetch-tags: true guarantees the CI runs with complete commit history and tag data, which aligns with the updated gen_versions_map.sh logic.

@kvaps
Andrei Kvapil (kvaps) merged commit a6b02bf into main Apr 22, 2025
@kvaps
Andrei Kvapil (kvaps) deleted the fix-escaping-ver-gen branch April 22, 2025 16:38
Nick Volynkin (NickVolynkin) pushed a commit that referenced this pull request Apr 23, 2025
)

Third attempt to fix #842 and
#836

tested in
https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

**Chores**
- Improved GitHub Actions workflow to fetch full git history and tags
during pre-commit checks.

**Refactor**
- Updated script behavior to display error messages when version
extraction from git fails, making troubleshooting easier.

(cherry picked from commit a6b02bf)
Signed-off-by: Nick Volynkin <nick.volynkin@gmail.com>
Nick Volynkin (NickVolynkin) pushed a commit that referenced this pull request Apr 23, 2025
)

Backport of #845 to release-v0.30

Third attempt to fix #842 and
#836

tested in
https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

**Chores**
- Improved GitHub Actions workflow to fetch full git history and tags
during pre-commit checks.

**Refactor**
- Updated script behavior to display error messages when version
extraction from git fails, making troubleshooting easier.

(cherry picked from commit a6b02bf)
Signed-off-by: Nick Volynkin <nick.volynkin@gmail.com>
Nick Volynkin (NickVolynkin) pushed a commit that referenced this pull request Apr 23, 2025
)

Backport of #845 to release-v0.30

Third attempt to fix #842 and
#836

tested in
https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

**Chores**
- Improved GitHub Actions workflow to fetch full git history and tags
during pre-commit checks.

**Refactor**
- Updated script behavior to display error messages when version
extraction from git fails, making troubleshooting easier.

(cherry picked from commit a6b02bf)
Signed-off-by: Nick Volynkin <nick.volynkin@gmail.com>
Nick Volynkin (NickVolynkin) pushed a commit that referenced this pull request Apr 23, 2025
)

Backport of #845 to release-v0.30

Third attempt to fix #842 and
#836

tested in
https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

**Chores**
- Improved GitHub Actions workflow to fetch full git history and tags
during pre-commit checks.

**Refactor**
- Updated script behavior to display error messages when version
extraction from git fails, making troubleshooting easier.

(cherry picked from commit a6b02bf)
Signed-off-by: Nick Volynkin <nick.volynkin@gmail.com>
Nick Volynkin (NickVolynkin) pushed a commit that referenced this pull request Apr 23, 2025
)

Backport of #845 to release-v0.30

Third attempt to fix #842 and
#836

tested in
https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

**Chores**
- Improved GitHub Actions workflow to fetch full git history and tags
during pre-commit checks.

**Refactor**
- Updated script behavior to display error messages when version
extraction from git fails, making troubleshooting easier.

(cherry picked from commit a6b02bf)
Signed-off-by: Nick Volynkin <nick.volynkin@gmail.com>
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