-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add shadow merge queue workflow with configurable settings #2
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
igorjs
wants to merge
22
commits into
main
Choose a base branch
from
add-shadow-merge-queue
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.
Conversation
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
7d8bf66 to
6de675d
Compare
Signed-off-by: igorjs <oss@mail.igorjs.io>
6de675d to
50a9c02
Compare
- Add GITHUB_TOKEN environment variable to merge-queue.yml workflow - Change trailingCommas setting in biome.json from 'es5' to 'all' - Remove trailing commas from string literals in src/index.ts function calls Signed-off-by: igorjs <oss@mail.igorjs.io>
Adds the issues:write permission to allow the merge queue workflow to create and update the dashboard issue. This fixes the "Resource not accessible by integration" error.
- Automatically create mq/* labels on action initialization - Auto-create dashboard label if missing when creating dashboard issue - Add initializeLabels() function to create all merge queue labels - Update dashboard operations to ensure labels exist before use This eliminates the need for manual label creation and ensures all required resources are created automatically by the action. Labels created: - mq/queued, mq/staging, mq/testing - mq/conflict, mq/fastlane, mq/hold - mq/ready, mq/failed - merge-queue-dashboard (when dashboard is enabled)
- Implement proper issue pinning using GraphQL API - Add automatic issue locking to prevent user comments - Lock dashboard issues with 'resolved' reason - Update README with required permissions documentation - Add auto-created resources section to docs Changes: - Replace commented pinIssue() with working GraphQL implementation - Add lockIssue() function to lock dashboard conversations - Add getIssueNodeId() helper for GraphQL operations - Update both createNewIssue() and updateExistingIssue() to lock - Document all required permissions (contents, pull-requests, statuses, issues) - Document auto-created resources (labels, dashboard, state branch) Fixes: - Dashboard issue not being pinned - Dashboard issue conversation not locked
- Change default dashboard_label from "merge-queue-dashboard" to "mq/dashboard" - Add mq/dashboard to auto-created labels list - Update workflow configuration to use new label name - Update README documentation with new label name This ensures all merge queue labels follow the consistent "mq/*" prefix pattern for better organization and clarity.
Simplify getLabelsToUse() to just return the dashboard label without checking/creating it, since initializeLabels() already handles all label creation at the start of the workflow. This removes the confusing "Dashboard label not found" info message that appeared even though the label was being created. The "No eligible PR found to process" message is intentional and informational - it just means there are no approved PRs ready to enter the queue.
Add new github-cli.ts module that wraps gh CLI commands with a type-safe interface, replacing direct Octokit API calls. Features: - Label operations (list, create) - Issue operations (list, get, create, update, lock, comment, pin) - PR operations (get, update-branch, merge, GraphQL fetch) - Git ref operations (get, create, update, delete) - Repository operations (compare, status, merge) - Content operations (get, put files) All functions use @actions/exec to execute gh commands and parse JSON responses, maintaining compatibility with existing Octokit response structures where possible. Savepoint: Core CLI module created, ready for migration.
Replace Octokit label operations with gh CLI: - initializeLabels() now uses gh.listLabels() and gh.createLabel() - Remove octokit parameter from initializeLabels() Savepoint: Label operations migrated.
Replace Octokit issue operations with gh CLI: - listIssues() for finding existing dashboard - createIssue() for creating new dashboard - updateIssue() for updating dashboard body - lockIssue() for locking conversations - pinIssue() for pinning dashboard - Remove octokit parameter from createDashboardOperations() Savepoint: Dashboard/issue operations migrated.
Replace Octokit git ref operations with gh CLI: - getBranchSha() uses gh.getRef() - ensureBranch() uses gh.updateRef() and gh.createRef() - deleteBranch() uses gh.deleteRef() - Simplified error handling (404 detection happens in gh module) - Remove octokit parameter from createBranchOperations() Savepoint: Branch operations migrated.
Replace Octokit content operations with gh CLI: - fetchQueueFile() uses gh.getFileContents() - initializeQueueFile() uses gh.putFileContents() - writeQueue() uses gh.putFileContents() - Simplified error handling (no more isOctokitError checks) - Remove octokit parameter from createQueueOperations() Savepoint: Queue/content operations migrated.
Final migration changes: - Replaced all remaining Octokit calls with gh CLI equivalents - Removed unused octokit variable declarations - Removed isOctokitError() helper and OctokitError interface - Simplified getErrorMessage() function - All PR, repo, and merge operations now use gh CLI Summary of migration: - 27 Octokit API calls replaced with gh CLI - Label ops: gh.listLabels(), gh.createLabel() - Issue ops: gh.listIssues(), gh.createIssue(), gh.updateIssue(), gh.lockIssue(), gh.pinIssue(), gh.commentOnIssue() - PR ops: gh.getPullRequest(), gh.updatePullRequestBranch(), gh.mergePullRequest(), gh.fetchOpenPRs() - Branch ops: gh.getRef(), gh.createRef(), gh.updateRef(), gh.deleteRef() - Repo ops: gh.compareCommits(), gh.createCommitStatus(), gh.mergeBranches() - Content ops: gh.getFileContents(), gh.putFileContents() Kept: @actions/github for github.context.repo only Savepoint: Complete gh CLI migration.
Built action with complete GitHub CLI integration. Bundle size increased slightly due to @actions/exec addition. All Octokit API calls have been replaced with gh CLI commands.
Remove nonsense 【...】 citation references from: - README.md: removed GitHub docs citations, simplified License/CoC sections - CODE_OF_CONDUCT.md: removed all citation artifacts, condensed content - CONTRIBUTING.md: removed citation artifacts, added proper link to CoC - SECURITY.md: removed GitHub recommendation citation All documentation is now clean and concise without AI-generated reference artifacts.
- Update workflow to use dynamic branch reference instead of hardcoded main - Replace GraphQL API calls with direct gh CLI commands for better maintainability - Remove unused getIssueNodeId function and GraphQLPRNode interface - Simplify PR fetching logic by using gh pr list instead of custom GraphQL query Signed-off-by: igorjs <oss@mail.igorjs.io>
…on character escape Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- Configure git user email with numeric ID format - Add signoff to dist folder commit - Update git config to use numeric user ID in email Signed-off-by: igorjs <oss@mail.igorjs.io>
…ching - Remove custom ExecError interface and isExecError helper function - Directly parse HTTP status codes from error messages in deleteRef and mergeBranches functions - Add headRefOid to PR data fetching to get commit SHA without separate API call - Improve error parsing by checking message content directly instead of using custom error types Signed-off-by: igorjs <oss@mail.igorjs.io>
…ocumentation - Add comprehensive 'How It Works' section explaining the 6-step merge queue process - Expand branch protection configuration with rationale for each setting - Document common use cases including fastlane, auto-update, squash merge, multiple bases, shadow mode, high-frequency processing, and monorepo configurations - Introduce troubleshooting guide covering queue processing issues, merge conflicts, base movement, stale branches, and dashboard creation problems - Add new ALGORITHM.md detailing the FIFO queue system, core concepts, and algorithm flow with diagram - Add new ARCHITECTURE.md documenting the TypeScript implementation, components, data flow, and operation factories - Add new FAQ.md answering common questions about modes, queue behaviour, configuration, and advanced usage Signed-off-by: igorjs <oss@mail.igorjs.io>
…ommit threshold - Change action reference from branch to main - Switch mode from shadow to live - Reduce behind_max_commits from 100 to 5 Signed-off-by: igorjs <oss@mail.igorjs.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #
📑 Description
✅ Checks
ℹ Additional Information