-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add queensac action for GitHub repository link checks #296
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
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a new composite GitHub Action Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Actions runner
participant Action as composite action (action.yml)
participant Shell as shell steps
participant Queensac as queensac binary
Runner->>Action: uses reddevilmidzy/queensac
Action->>Shell: Step 1: install queensac (cargo install)
Shell->>Shell: set -eo pipefail\ncargo install --locked --git ... queensac\nexport PATH
Action->>Shell: Step 2: run queensac
note right of Shell `#E8F6EF`: Env forwarded:\nQUEENSAC_APP_ID\nQUEENSAC_APP_PRIVATE_KEY
Shell->>Queensac: queensac --repo <repo> [--branch <branch>] [--dry-run]
Queensac-->>Shell: exit code / output
Shell-->>Runner: step status
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new GitHub Action for the queensac tool that checks repository links and optionally creates pull requests to fix broken links. The main changes involve renaming environment variables from GITHUB_APP_* to QUEENSAC_APP_* to better align with the action's branding and avoid naming conflicts.
- Added a new
action.ymlfile that defines the queensac GitHub Action with configurable inputs - Updated environment variable references from
GITHUB_APP_ID/GITHUB_APP_PRIVATE_KEYtoQUEENSAC_APP_ID/QUEENSAC_APP_PRIVATE_KEYacross the codebase - Updated error messages and documentation to reflect the new environment variable names
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| action.yml | Newly added GitHub Action definition with inputs for repo URL, branch, dry-run mode, and GitHub App credentials |
| src/main.rs | Updated error message to reference the new QUEENSAC_APP_ID and QUEENSAC_APP_PRIVATE_KEY environment variables |
| src/git/pr_generator.rs | Updated GitHubAppConfig::from_env() to read from QUEENSAC_APP_* environment variables and updated corresponding documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull Request Test Coverage Report for Build 19291944401Details
💛 - Coveralls |
There was a problem hiding this 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
🧹 Nitpick comments (1)
action.yml (1)
27-33: Consider optimizing installation performance.The action installs queensac from source using
cargo install --pathon every run, which requires compiling the entire Rust project. This can significantly slow down workflow execution times.Consider:
- Using actions/cache to cache cargo build artifacts
- Pre-building and distributing binaries for common platforms
- Documenting the expected installation time in the action description
Example caching setup:
- name: Cache cargo build uses: actions/cache@v4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
action.yml(1 hunks)src/git/pr_generator.rs(1 hunks)src/main.rs(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: reddevilmidzy
Repo: reddevilmidzy/queensac PR: 226
File: src/main.rs:21-32
Timestamp: 2025-09-22T15:50:19.531Z
Learning: User reddevilmidzy prefers to communicate in Korean and likes to keep PR scope focused and well-defined.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: test
- GitHub Check: Agent
- GitHub Check: Analyze (rust)
🔇 Additional comments (3)
src/main.rs (1)
72-72: LGTM! Error message updated correctly.The error message now references the renamed environment variables
QUEENSAC_APP_IDandQUEENSAC_APP_PRIVATE_KEY, which is consistent with the changes insrc/git/pr_generator.rs.src/git/pr_generator.rs (1)
50-57: LGTM! Environment variable renaming is consistent.The documentation comments and environment variable names have been properly updated from
GITHUB_APP_*toQUEENSAC_APP_*. The error messages correctly reference the new variable names.action.yml (1)
34-56: Run step implementation looks good.The command construction logic correctly handles optional inputs and sets the renamed environment variables
QUEENSAC_APP_IDandQUEENSAC_APP_PRIVATE_KEYthat align with the code changes insrc/git/pr_generator.rsandsrc/main.rs.Note: Runtime validation for required GitHub App credentials is handled by the Rust code (lines 71-74 in
src/main.rs), which will exit with an error if the credentials are missing when needed.
Introduce a new GitHub Action named "queensac" that checks repository links and optionally opens pull requests to fix them. The action includes configurable inputs for repository URL, target branch, dry-run mode, and GitHub App credentials. Additionally, update environment variable references in the code to align with the new action's naming conventions.
df00508 to
4b7e02f
Compare
There was a problem hiding this comment.
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)
action.yml (1)
18-23: Clarify conditional input requirements in descriptions.The
github_app_idandgithub_app_private_keyinputs are marked as optional but are actually required whendry-runisfalse(to create pull requests). Consider updating the input descriptions to clarify this dependency:github_app_id: - description: "GitHub App ID to use when creating pull requests." + description: "GitHub App ID to use when creating pull requests. Required when dry-run is false." required: false github_app_private_key: - description: "GitHub App private key (PEM) to use when creating pull requests." + description: "GitHub App private key (PEM) to use when creating pull requests. Required when dry-run is false." required: falseThis aligns with user expectations and makes the usage clearer, especially for users who attempt non-dry-run executions without these credentials.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
README.ko.md(1 hunks)README.md(1 hunks)action.yml(1 hunks)src/git/pr_generator.rs(1 hunks)src/main.rs(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- README.ko.md
🚧 Files skipped from review as they are similar to previous changes (2)
- src/main.rs
- src/git/pr_generator.rs
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: reddevilmidzy
Repo: reddevilmidzy/queensac PR: 226
File: src/main.rs:21-32
Timestamp: 2025-09-22T15:50:19.531Z
Learning: User reddevilmidzy prefers to communicate in Korean and likes to keep PR scope focused and well-defined.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: Analyze (rust)
🔇 Additional comments (3)
README.md (1)
34-36: Documentation now correctly reflects the GitHub App authentication approach.The updated example properly demonstrates the new
github_app_idandgithub_app_private_keyinputs alongside therepoparameter, making the usage clear and consistent with the action.yml implementation.action.yml (2)
27-33: Installation step is solid.The rustup update and cargo install pattern is robust, with proper PATH management for subsequent steps.
34-56: Command construction and parameter handling are well-implemented.The run step properly handles:
- Environment variable mapping for GitHub App credentials (lines 37-38)
- Conditional default for
repoinput (lines 43-45)- Conditional parameter addition for
branch(lines 49-51) anddry-run(lines 53-55)- Array-based command construction to prevent word-splitting issues
Both steps use
set -eo pipefailfor robust error handling.
♟️ What’s this PR about?
Introduce a new GitHub Action named "queensac" that checks repository links and optionally opens pull requests to fix them. The action includes configurable inputs for repository URL, target branch, dry-run mode, and GitHub App credentials. Additionally, update environment variable references in the code to align with the new action's naming conventions.
🔗 Related Issues / PRs
resolve: #295
Summary by CodeRabbit
New Features
Chores