RC #268 - #269
Merged
Merged
Conversation
- Removed unused constants and imports in rc-workflow.ts. - Updated generateReleaseNotes function to accept a showLog parameter for logging control. - Enhanced RCWorkflow class to manage branches and pull requests more effectively, including: - Added logic to switch to the dev branch if not already on it. - Improved handling of existing RC issues and pull requests. - Introduced methods for fetching and updating release notes, issues, branches, and pull requests. - Created a manual process guide for Release Candidate management. - Refactored Git utility functions for better branch handling and commit range determination.
Reviewer's GuideIntroduces an automated release-candidate workflow that creates/updates RC issues, branches, and PRs; improves Git utilities, docs build flexibility, and .github sync robustness; and refactors commit analysis to better generate release notes. Sequence diagram for the rc-workflow CLI executionsequenceDiagram
actor Developer
participant CLI as rc-workflow_command
participant RCWF as RCWorkflow
participant GitUtil as Git
participant SGit as simpleGit
participant GH as Octokit_GitHub_API
Developer->>CLI: run auro rc-workflow
CLI->>RCWF: RCWorkflow.create()
RCWF->>GitUtil: getRepoOwnerAndName()
GitUtil-->>RCWF: { owner, repo }
RCWF->>RCWF: getTriggerBranchName()
alt trigger branch not dev
RCWF->>SGit: checkout(dev)
end
RCWF-->>CLI: RCWorkflow instance
CLI->>RCWF: createReleaseCandidate()
RCWF->>RCWF: hasCommitsReadyInDev()
RCWF->>GitUtil: getCommitMessages("dev")
GitUtil-->>RCWF: commitList
RCWF->>CommitAnalyzerModule: filterCommitList(commitList)
CommitAnalyzerModule-->>RCWF: filteredCommits
alt no filteredCommits
RCWF->>Developer: log "No filtered commits found"
end
RCWF->>GH: listForRepo(label=Release_Candidate, state=open)
GH-->>RCWF: issues
alt existing open RC issue
RCWF->>GH: update(issue_number, title, body=releaseNotes)
else no RC issue
RCWF->>CommitAnalyzerModule: generateReleaseNotes(filteredCommits, false)
CommitAnalyzerModule-->>RCWF: releaseNotes
RCWF->>GH: create(issue with label Release_Candidate)
GH-->>RCWF: newIssue
end
RCWF->>GH: getBranch(branch=dev)
GH-->>RCWF: devBranchSha
RCWF->>GH: listMatchingRefs(ref=heads/rc_issue)
GH-->>RCWF: matchingRefs
alt RC branch exists
RCWF->>GH: updateRef(ref=heads/rc_issue, sha=devBranchSha, force=true)
else RC branch missing
RCWF->>GH: createRef(ref=refs/heads/rc_issue, sha=devBranchSha)
end
RCWF->>GH: list PRs by head=owner:rc_issue
GH-->>RCWF: prs
alt no existing PR
RCWF->>GH: getContent(.github/PULL_REQUEST_TEMPLATE.md)
GH-->>RCWF: template or 404
RCWF->>GH: create PR(base=main, head=rc_issue, title=RC_#issue)
else existing PR
RCWF->>GH: update PR body with refreshed template
end
RCWF-->>CLI: done
CLI-->>Developer: prints links to issue and PR
Class diagram for RCWorkflow and related utilitiesclassDiagram
class Git {
+getCommitMessages(sourceBranch : string) Promise~Array~
+getRepoOwnerAndName() Promise~RepoInfo or null~
+getCurrentBranchName() Promise~string or null~
-parseGitUrl(url : string) RepoInfo or null
}
class RCWorkflow {
-repoInfo : RepoInfo
-octokit : Octokit
-filteredCommits : Array~CommitInfo~ or null
+RCWorkflow(owner : string, repo : string, octokit : Octokit)
+create() Promise~RCWorkflow~
+createReleaseCandidate() Promise~void~
+hasCommitsReadyInDev() Promise~boolean~
+getReleaseNotes() Promise~string~
+owner : string
+repo : string
+repoData : RepoInfo
-getFilteredCommits() Promise~Array~
-getLatestOpenRcIssue() Promise~RcIssue or null~
-updateRcIssue(issueNumber : number) Promise~void~
-createRcIssue() Promise~RcIssue~
-createOrUpdateRcBranch(issueNumber : number) Promise~void~
-getLinkedPrByHead(issueNumber : number) Promise~LinkedPr or null~
-fetchPrTemplate(issueNumber : number) Promise~string~
-createRcPr(issueNumber : number) Promise~LinkedPr~
-updateRcPr(issueNumber : number, prNumber : number) Promise~void~
-getTriggerBranchName() Promise~string or null~
-getCurrentDate() string
}
class CommitAnalyzerModule {
<<module>>
+generateReleaseNotes(commitList : Array~CommitInfo~, showLog : boolean) string
+filterCommitList(commitList : Array~CommitInfo~, fallbackCommits : boolean) Array~CommitInfo~
}
class DocsBuildModule {
<<module>>
+defaultDocsProcessorConfig : ProcessorConfig
+fileConfigs(config : ProcessorConfig, skipReadme : boolean) Promise~Array~
+processDocFiles(config : ProcessorConfig, skipReadme : boolean) Promise~void~
+runDefaultDocsBuild(options : DocsOptions) Promise~void~
-fileExists(pathToFile : string) boolean
}
class SyncDotGithubModule {
<<module>>
+syncDotGithubDir(rootDir : string, ref : string, template : string) Promise~void~
-getFolderItemsFromRelativeRepoPath(path : string, ref : string) Promise~Array~
-processFolderItemsIntoFileConfigs(args : ProcessIntoFileConfigArgs) Promise~Array~
-removeDirectory(dirPath : string) Promise~void~
-generateDirectoryTree(dirPath : string, prefix : string, isLast : boolean) Promise~string~
}
class RcWorkflowCommand {
<<command>>
+rc-workflow()
}
class DocsCommand {
<<command>>
+docs(options)
}
class SyncCommand {
<<command>>
+sync(options)
}
class RepoInfo {
+owner : string
+repo : string
}
class CommitInfo {
+type : string
+hash : string
+date : string
+subject : string
+body : string
+message : string
+author_name : string
}
class RcIssue {
+number : number
+title : string
+html_url : string
}
class LinkedPr {
+state : string
+html_url : string
+multipleOpen : boolean
+number : number
}
class ProcessorConfig {
+overwriteLocalCopies : boolean
+remoteReadmeVersion : string
+remoteReadmeUrl : string
+remoteReadmeVariant : string
}
class DocsOptions {
+skipReadme : boolean
}
RCWorkflow --> Git : uses
RCWorkflow --> CommitAnalyzerModule : uses
RCWorkflow --> RepoInfo
RCWorkflow --> RcIssue
RCWorkflow --> LinkedPr
RCWorkflowCommand --> RCWorkflow : creates
DocsBuildModule --> ProcessorConfig
DocsCommand --> DocsBuildModule : uses
SyncDotGithubModule --> RepoInfo
SyncCommand --> SyncDotGithubModule : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In
Git.getRepoOwnerAndName,remote.refs.fetch || remote.refs.pushcan beundefined, which will causeparseGitUrlto throw when callingurl.includes; consider guarding against a missing URL and logging/returningnullearly instead. - The side effect in
RCWorkflow.createthat automatically checks out thedevbranch can surprise callers and potentially conflict with uncommitted changes; consider either validating the working tree is clean before switching branches or moving the checkout responsibility to the CLI layer with an explicit prompt/flag. - In
src/commands/sync.js, thecatchblocks assumeerrorhas a.messageproperty; to avoid losing error information when a non-Erroris thrown, consider normalizing viaerror instanceof Error ? error.message : String(error)before logging.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `Git.getRepoOwnerAndName`, `remote.refs.fetch || remote.refs.push` can be `undefined`, which will cause `parseGitUrl` to throw when calling `url.includes`; consider guarding against a missing URL and logging/returning `null` early instead.
- The side effect in `RCWorkflow.create` that automatically checks out the `dev` branch can surprise callers and potentially conflict with uncommitted changes; consider either validating the working tree is clean before switching branches or moving the checkout responsibility to the CLI layer with an explicit prompt/flag.
- In `src/commands/sync.js`, the `catch` blocks assume `error` has a `.message` property; to avoid losing error information when a non-`Error` is thrown, consider normalizing via `error instanceof Error ? error.message : String(error)` before logging.
## Individual Comments
### Comment 1
<location> `src/scripts/rc-workflow/index.ts:49-53` </location>
<code_context>
+ throw new Error("Failed to retrieve repository information. Ensure you're in a valid git repository.");
+ }
+
+ const triggerBranch = await RCWorkflow.getTriggerBranchName();
+ if (triggerBranch && triggerBranch !== RC_SOURCE_BRANCH) {
+ console.log(`Switching from ${triggerBranch} to ${RC_SOURCE_BRANCH} branch...`);
+ const git = simpleGit();
+ await git.checkout(RC_SOURCE_BRANCH);
+ }
+
</code_context>
<issue_to_address>
**issue:** Blindly checking out the RC source branch can fail if the branch does not exist locally.
If the RC source branch doesn’t exist locally (fresh clone, different naming, or a fork), `simpleGit().checkout(RC_SOURCE_BRANCH)` will throw with an unhelpful error. Consider checking that the branch exists (and fetching it if needed) before checkout, or catching the failure and rethrowing a clearer error that explains how to fix the local git state.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
jason-capsule42
approved these changes
Feb 17, 2026
Member
|
🎉 This PR is included in version 3.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
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.
Alaska Airlines Pull Request
Release candidate pull request. See issue #268 for details.
Checklist:
By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.
Thank you for your submission!
-- Auro Design System Team
Summary by Sourcery
Introduce an automated release candidate workflow and improve documentation and synchronization tooling.
New Features:
Enhancements:
Documentation: