Skip to content

RC #268 - #269

Merged
jason-capsule42 merged 11 commits into
mainfrom
rc/268
Feb 17, 2026
Merged

RC #268#269
jason-capsule42 merged 11 commits into
mainfrom
rc/268

Conversation

@rmenner

@rmenner rmenner commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator

Alaska Airlines Pull Request

Release candidate pull request. See issue #268 for details.

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

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:

  • Add an rc-workflow command and supporting RCWorkflow class to automatically create/update release candidate issues, branches, and pull requests based on commit history.
  • Expose utilities to retrieve repository owner/name and current branch from git configuration for use in automation workflows.
  • Extend the docs generation command to accept options for skipping README processing and handling additional page templates discovered in the repo.

Enhancements:

  • Make commit range calculation in Git utilities branch-aware and more robust in both local and CI environments.
  • Refine release-notes generation by separating commit filtering from note rendering and expanding the set of commit types considered for releases.
  • Improve .github sync script to validate templates before deleting local configuration and to support selecting a template via CLI options, with better error handling.
  • Update docs build pipeline to conditionally process files only when present, add support for page templates, and allow skipping README generation.

Documentation:

  • Add a manual release candidate process guide describing how to create and manage RC issues, branches, and pull requests when automation is unavailable.

jordanjones243 and others added 11 commits January 27, 2026 10:36
- 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.
@rmenner
rmenner requested a review from a team as a code owner February 16, 2026 17:33
@sourcery-ai

sourcery-ai Bot commented Feb 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces 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 execution

sequenceDiagram
  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
Loading

Class diagram for RCWorkflow and related utilities

classDiagram
  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
Loading

File-Level Changes

Change Details Files
Enhance Git utilities to support branch-aware commit range calculation and expose repo/branch metadata helpers.
  • Add optional sourceBranch parameter to commit retrieval and use it consistently in CI and local environments.
  • Ensure source branch refs exist locally/remotely before computing merge bases and fall back to branch-local history if merge-base fails.
  • Provide helpers to derive repo owner/name from git remotes and to get the current branch name, including robust URL parsing.
src/utils/gitUtils.ts
Make docs build pipeline more flexible and file-aware, including optional README generation and dynamic page template handling.
  • Convert fileConfigs from a static list to an async, conditional builder that can skip README and only process existing partials.
  • Add support for generating /demo pages from files under /docs/pages and introduce skipReadme option through docs CLI and pipeline.
  • Introduce a fileExists helper and wire new options through processDocFiles, runDefaultDocsBuild, docs script, and docs CLI command.
src/scripts/build/defaultDocsBuild.js
src/scripts/docs/index.ts
src/commands/docs.ts
Harden .github sync script with better error handling, template selection, and non-destructive validation before deletion.
  • Wrap GitHub contents fetch with type checking and differentiated 404 vs generic error handling.
  • Allow choosing a template subdirectory when syncing .github and validate template existence before removing local .github.
  • Replace process.exit usage with thrown errors for better composability, and improve sync command’s error reporting and CODEOWNERS post-processing robustness.
src/scripts/syncDotGithubDir.ts
src/commands/sync.js
Refactor commit analysis to separate filtering from rendering and to generate reusable release notes strings.
  • Change generateReleaseNotes to return a formatted markdown string with optional logging instead of printing directly.
  • Introduce filterCommitList with configurable fallback behavior and reuse it when generating release notes in analyzeCommits.
  • Expand considered release commit types to include perf and use shared constant for release-related filtering.
src/scripts/check-commits/commit-analyzer.ts
Introduce an automated RC workflow that orchestrates issues, branches, and PRs based on dev commits and repository metadata.
  • Add RCWorkflow class that discovers repo info, normalizes to dev branch, filters commits, and generates release notes for RCs.
  • Implement logic to find or create a labeled RC issue, create/update rc/{issueNumber} branch from dev, and create/update an RC PR into main using PR templates when available.
  • Provide a manual RC process guide and wire a new rc-workflow CLI command that runs the automated workflow.
src/scripts/rc-workflow/index.ts
src/scripts/rc-workflow/manual-rc-process.md
src/commands/rc-workflow.ts
src/index.ts
package-lock.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • 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.
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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/scripts/rc-workflow/index.ts
@jason-capsule42
jason-capsule42 merged commit ec902db into main Feb 17, 2026
14 checks passed
@jason-capsule42
jason-capsule42 deleted the rc/268 branch February 17, 2026 16:37
@jason-capsule42

Copy link
Copy Markdown
Member

🎉 This PR is included in version 3.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jason-capsule42 jason-capsule42 added the released Completed work has been released label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Completed work has been released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants