Skip to content

ci: Automate develop sync#40885

Open
sampaiodiego wants to merge 3 commits into
developfrom
automate-develop-sync
Open

ci: Automate develop sync#40885
sampaiodiego wants to merge 3 commits into
developfrom
automate-develop-sync

Conversation

@sampaiodiego

@sampaiodiego sampaiodiego commented Jun 10, 2026

Copy link
Copy Markdown
Member

Proposed changes

Automates the develop sync that's required after every release merged to master. Today this is a recurring manual chore: each release bumps the version line in ~76 package.json files (+ apps/meteor/app/utils/rocketchat.info), leaving develop behind master and blocking the next release branch from merging cleanly.

How it works

A new sync-develop mode in packages/release-action runs after the Publish Final Release workflow succeeds (via workflow_run). It merges master into a sync/master-to-develop-<sha> branch and classifies conflicts into three tiers:

Conflicts Resolution PR
version files only (package.json, rocketchat.info) --ours (develop wins) auto-merge enabled
version files + CHANGELOG.md version files --ours; changelogs union-merged (lossless) review PR (no auto-merge)
any other (code) conflict none — abort manual-resolution PR

If develop already contains master, it exits without opening a PR. PRs are idempotent (an existing open sync PR is updated, not duplicated). All sync-PR titles use the chore: prefix to satisfy the repo's PR title rules. Auto-merge uses the MERGE method so master's history is preserved on develop, and goes through branch protection / CI like any other PR.

Why workflow_run (not a step in the publish job)

Decouples the sync from the release job — a sync failure never blocks or obscures the publish — and it only fires when the release actually succeeded. It also naturally skips the old-version patch flow, which never pushes to master.

Files

  • packages/release-action/src/syncDevelop.ts — new sync logic
  • packages/release-action/src/gitUtils.ts — git primitives (fetch, merge --no-commit, conflict listing, checkout --ours, ancestor check, union helpers)
  • packages/release-action/src/index.ts / action.yml — wire the sync-develop mode
  • packages/release-action/src/utils.ts — export getUpdateFilesList
  • .github/workflows/develop-sync.yml — trigger workflow

Notes / follow-ups

  • No changeset: this is CI/release tooling with no end-user impact.
  • The bundled dist/index.js is gitignored and built in CI (the workflow builds the action before use), so it isn't committed.
  • End-to-end behavior can only be fully exercised on a real release (or a fork).
  • Out of scope (deliberate): syncing an in-flight release-X.Y.Z minor branch, and a version-aware (vs. union) changelog merge.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added automated workflow to synchronize the develop branch with master upon successful release publication, including intelligent conflict resolution and automatic pull request creation.

sampaiodiego and others added 3 commits June 10, 2026 19:39
Adds syncDevelopWithMaster() which merges master into develop after a
release, resolving version-bump conflicts in develop's favour and routing
changelog/code conflicts to review/manual sync PRs. Adds the git
primitives it needs to gitUtils and exports getUpdateFilesList.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Runs after 'Publish Final Release' succeeds and invokes the release-action
sync-develop mode to open a develop<-master sync PR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dionisio-bot

dionisio-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 49fa221

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

A new GitHub Actions workflow and release action feature automates synchronization of the master branch into develop after final release publication. Git utilities support merge and conflict operations, conflict classification logic routes unresolvable conflicts to manual PRs while resolving version files and changelogs automatically, and idempotent PR management with conditional auto-merge enables streamlined post-release branch alignment.

Changes

Develop-master sync feature

Layer / File(s) Summary
Git utilities for merge and conflict handling
packages/release-action/src/gitUtils.ts
New exported functions support merge operations without committing, conflict detection and file classification, staging, ancestry checking, SHA retrieval, and file content inspection. Provides the foundational git operations for the sync workflow.
Sync develop with master implementation
packages/release-action/src/syncDevelop.ts, packages/release-action/src/utils.ts
Main sync routine orchestrates master-to-develop merge, classifies conflicts into version files, changelog files, and other files, applies tiered resolution (manual PR for unresolvable; version/changelog union merge for resolvable), manages idempotent PR creation/update, and conditionally enables auto-merge. Includes conflict classification, changelog union merge, PR body generation, and auto-merge GraphQL mutation logic. Exports a utility function for file listing.
Action entry point and workflow trigger
packages/release-action/src/index.ts, packages/release-action/action.yml, .github/workflows/develop-sync.yml
Wires the new sync-develop action into the release-action dispatcher, documents the action option in the action descriptor, and defines a GitHub Actions workflow that triggers after final release publication, checks out code, builds the release action, and invokes it with CI credentials.

Sequence Diagram

sequenceDiagram
  participant Action as release-action
  participant Sync as syncDevelopWithMaster
  participant Git as git operations
  participant Github as GitHub API
  Action->>Sync: githubToken
  Sync->>Git: fetch master, develop refs
  Sync->>Git: merge master (no-commit)
  Git-->>Sync: conflicted files
  Sync->>Sync: classify conflicts
  alt unresolvable conflicts
    Sync->>Git: abort merge, reset
    Sync->>Github: create manual-resolution PR
  else only version/changelog conflicts
    Sync->>Git: checkout ours (versions)
    Sync->>Git: union merge CHANGELOG.md
    Sync->>Git: add files, commit, push
    Sync->>Github: create/update PR
    alt changelog involved
      Github-->>Sync: PR created
    else clean sync
      Sync->>Github: enable auto-merge
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

type: feature

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: Automate develop sync' clearly and concisely describes the main change: automating the synchronization of the develop branch with master via CI workflows.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.98%. Comparing base (3a72f99) to head (49fa221).
⚠️ Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40885      +/-   ##
===========================================
+ Coverage    69.96%   69.98%   +0.01%     
===========================================
  Files         3353     3353              
  Lines       128820   128820              
  Branches     22294    22267      -27     
===========================================
+ Hits         90132    90151      +19     
+ Misses       35397    35375      -22     
- Partials      3291     3294       +3     
Flag Coverage Δ
e2e 59.26% <ø> (+0.04%) ⬆️
e2e-api 46.24% <ø> (+<0.01%) ⬆️
unit 69.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sampaiodiego sampaiodiego marked this pull request as ready for review June 11, 2026 19:20
@sampaiodiego sampaiodiego requested a review from a team as a code owner June 11, 2026 19:20
@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label Jun 11, 2026

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

🧹 Nitpick comments (16)
packages/release-action/src/syncDevelop.ts (10)

93-93: ⚡ Quick win

Remove implementation comment per coding guidelines.

The variable name extraVersionFiles and filter operation are self-documenting.

♻️ Suggested diff
-	// the non-package.json version files (e.g. apps/meteor/app/utils/rocketchat.info)
 	const extraVersionFiles = (await getUpdateFilesList(cwd)).filter((file) => path.basename(file) !== 'package.json');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` at line 93, Delete the
implementation comment "// the non-package.json version files (e.g.
apps/meteor/app/utils/rocketchat.info)" above the extraVersionFiles filter; the
variable name extraVersionFiles and its filter operation are self-explanatory,
so remove that stray comment to comply with coding guidelines.

Source: Coding guidelines


26-28: ⚡ Quick win

Remove implementation comment per coding guidelines.

The constant name TITLE_PREFIX and its value 'chore: sync develop with master' are self-documenting.

♻️ Suggested diff
-// Every sync PR title starts with this conventional prefix so it satisfies the
-// repo's PR title rules (see .github/PULL_REQUEST_TEMPLATE.md). A branch sync is
-// housekeeping with no end-user changelog impact, hence `chore:`.
 const TITLE_PREFIX = 'chore: sync develop with master';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` around lines 26 - 28, Remove the
surrounding explanatory comment above the TITLE_PREFIX constant: the name
TITLE_PREFIX and its value 'chore: sync develop with master' are
self-describing, so delete the multi-line implementation comment and leave only
the constant declaration (refer to TITLE_PREFIX in syncDevelop.ts) to comply
with coding guidelines.

Source: Coding guidelines


60-62: ⚡ Quick win

Remove implementation comment per coding guidelines.

The function name unionMergeChangelog and git command arguments document the behavior.

♻️ Suggested diff
-// Resolve a conflicted CHANGELOG.md with a lossless union of both sides so no
-// release notes are dropped. Ordering still needs a human eye, which is why the
-// changelog tier always opens a review PR rather than auto-merging.
 async function unionMergeChangelog(file: string) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` around lines 60 - 62, Remove the
implementation comment block that documents behavior above the
unionMergeChangelog function; the function name unionMergeChangelog and the git
command arguments already express the behavior, so delete the three-line
explanatory comment (about resolving conflicted CHANGELOG.md with a lossless
union and opening a review PR) to comply with coding guidelines and keep the
source concise.

Source: Coding guidelines


207-207: ⚡ Quick win

Remove implementation comment per coding guidelines.

The warning message in the catch block already explains the non-critical nature of the failure.

♻️ Suggested diff
 	} catch (err) {
-		// auto-merge may be disabled on the repo or the PR may already be mergeable; don't fail the sync
 		core.warning(`Could not enable auto-merge: ${(err as Error).message}`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` at line 207, Remove the
implementation comment "// auto-merge may be disabled on the repo or the PR may
already be mergeable; don't fail the sync" from the catch block in
syncDevelop.ts; leave the existing warning log message intact (do not change the
catch logic or logging), so only delete that explanatory inline comment per
coding guidelines.

Source: Coding guidelines


96-96: ⚡ Quick win

Remove implementation comment per coding guidelines.

The git operations that follow clearly show the branching and merging strategy.

♻️ Suggested diff
-	// branch off develop, then merge master into it
 	await resetBranchTo(syncBranch, `origin/${TARGET}`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` at line 96, Remove the redundant
implementation comment "// branch off develop, then merge master into it" from
the code (it's purely descriptive of the following git operations). Delete that
single-line comment in syncDevelop.ts so the code follows the guideline of
avoiding implementation comments; no code changes besides removing that comment
are needed.

Source: Coding guidelines


88-88: ⚡ Quick win

Remove implementation comment per coding guidelines.

The variable name version and JSON parsing already convey the purpose.

♻️ Suggested diff
-	// the released version, read from master's root package.json — used for titles
 	const { version } = JSON.parse(await showFile(`origin/${SOURCE}:package.json`));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` at line 88, Remove the
implementation comment "// the released version, read from master's root
package.json — used for titles" above the version variable; locate the
declaration named version (where JSON.parse is used to read package.json) and
delete that comment so the code follows the guideline that the variable name and
JSON parsing are self-descriptive.

Source: Coding guidelines


146-146: ⚡ Quick win

Remove implementation comment per coding guidelines.

The final ensurePullRequest call with autoMerge: true documents the tier-1 behavior.

♻️ Suggested diff
-	// Tier 1: only version lines conflicted (or a clean merge) → safe to auto-merge.
 	await ensurePullRequest({
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` at line 146, Remove the redundant
implementation comment "// Tier 1: only version lines conflicted (or a clean
merge) → safe to auto-merge." in syncDevelop.ts; the behavior is already
documented by the subsequent ensurePullRequest call that passes autoMerge: true,
so just delete that comment and leave the ensurePullRequest(...) invocation and
its autoMerge flag unchanged.

Source: Coding guidelines


103-104: ⚡ Quick win

Remove implementation comment per coding guidelines.

The condition, warning message, and subsequent operations document the tier-3 handling.

♻️ Suggested diff
-	// Tier 3: real code conflicts — we can't safely resolve. Open a manual PR with
-	// master as-is so a human resolves everything in the PR.
 	if (other.length > 0) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` around lines 103 - 104, Remove
the implementation-only comment "Tier 3: real code conflicts — we can't safely
resolve. Open a manual PR with master as-is so a human resolves everything in
the PR." from syncDevelop (packages/release-action/src/syncDevelop.ts) — delete
those lines so the code contains only the condition, warning message, and
operations themselves, aligning with the coding guideline to avoid
implementation comments.

Source: Coding guidelines


122-122: ⚡ Quick win

Remove implementation comment per coding guidelines.

The operations clearly show version and changelog conflict resolution.

♻️ Suggested diff
-	// resolve the predictable conflicts: version lines keep develop's side
 	for (const file of versionFiles) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` at line 122, Remove the
implementation-only comment "// resolve the predictable conflicts: version lines
keep develop's side" from packages/release-action/src/syncDevelop.ts (it is an
implementation detail comment in the sync logic); simply delete that line so the
code contains no explanatory implementation comment while leaving the
surrounding logic and any conflict-resolution behavior in the syncDevelop
function intact.

Source: Coding guidelines


134-134: ⚡ Quick win

Remove implementation comment per coding guidelines.

The condition and function call make the tier-2 handling clear.

♻️ Suggested diff
-	// Tier 2: changelog conflicts were auto-resolved but ordering needs review → no auto-merge.
 	if (changelogs.length > 0) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/syncDevelop.ts` at line 134, Remove the inline
implementation comment above the tier-2 branch (the comment starting with "Tier
2: changelog conflicts were auto-resolved but ordering needs review → no
auto-merge.") — delete that comment and leave the existing condition and
function call handling the tier-2 case untouched, since the condition and
invocation already make the behavior clear.

Source: Coding guidelines

.github/workflows/develop-sync.yml (1)

23-26: ⚡ Quick win

Consider adding persist-credentials: false for defense in depth.

While the CI_PAT token is necessary for subsequent git operations, explicitly setting persist-credentials: false prevents the token from being accessible to scripts run in later steps, reducing the attack surface if a compromised dependency or build script attempts to extract credentials.

🛡️ Suggested addition
       - name: Checkout Repo
         uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
         with:
           fetch-depth: 0
           token: ${{ secrets.CI_PAT }}
+          persist-credentials: false

Note: You'll need to ensure that git operations in the "Sync develop with master" step (line 38-43) explicitly use the token from the environment variable rather than relying on persisted credentials.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/develop-sync.yml around lines 23 - 26, Add
persist-credentials: false to the actions/checkout step to avoid exposing the
CI_PAT to later steps; update the checkout usage in the workflow (the
actions/checkout invocation shown) and ensure subsequent git operations in the
"Sync develop with master" step explicitly use the token from the environment
(e.g., the CI_PAT secret) rather than relying on persisted credentials.
packages/release-action/src/gitUtils.ts (5)

49-50: ⚡ Quick win

Remove implementation comment per coding guidelines.

The function signature and return type already document the behavior.

♻️ Suggested diff
-// start a merge but leave it uncommitted so conflicts can be inspected/resolved.
-// returns true when the merge applied cleanly, false when there are conflicts.
 export async function mergeNoCommit(ref: string): Promise<boolean> {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/gitUtils.ts` around lines 49 - 50, Remove the
redundant implementation comment above the merge helper in gitUtils.ts (the
two-line comment starting "// start a merge..." and "// returns true...")
because the function signature/return type already document its behavior; locate
the comment near the merge helper function (e.g., the function that returns a
boolean indicating whether the merge applied cleanly) and delete those lines to
comply with the coding guidelines.

Source: Coding guidelines


44-45: ⚡ Quick win

Remove implementation comment per coding guidelines.

The coding guidelines specify "Avoid code comments in the implementation" for TypeScript files. The function name and signature already convey the intent.

♻️ Suggested diff
-// reset/create a local branch pointing at the given ref (e.g. origin/develop)
 export async function resetBranchTo(branch: string, ref: string) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/gitUtils.ts` around lines 44 - 45, Remove the
inline implementation comment above the function declaration for resetBranchTo;
the function name and signature already convey intent, so delete the comment
line "// reset/create a local branch pointing at the given ref (e.g.
origin/develop)" directly above the export async function resetBranchTo(branch:
string, ref: string) declaration to comply with the TypeScript coding guideline
to avoid implementation comments.

Source: Coding guidelines


95-95: ⚡ Quick win

Remove implementation comment per coding guidelines.

The function name is self-documenting.

♻️ Suggested diff
-// contents of a file at a given ref (e.g. origin/master:package.json) or merge stage (e.g. :2:CHANGELOG.md)
 export async function showFile(ref: string): Promise<string> {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/gitUtils.ts` at line 95, Remove the redundant
implementation comment "// contents of a file (e.g. origin/master:package.json)
or merge stage (e.g. :2:CHANGELOG.md)" which simply restates the function
behavior; leave the surrounding code and function signature unchanged so the
function (the one that returns file contents at a ref/merge stage) remains
self-documenting without the comment.

Source: Coding guidelines


69-69: ⚡ Quick win

Remove implementation comment per coding guidelines.

The function name clearly describes the resolution strategy.

♻️ Suggested diff
-// resolve a conflicted file by keeping our side (the branch we merge into)
 export async function checkoutOurs(file: string) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/gitUtils.ts` at line 69, Remove the
implementation comment "// resolve a conflicted file by keeping our side (the
branch we merge into)" that sits above the conflict-resolution function; per
guidelines, delete this descriptive implementation comment and leave the
function (resolveConflictKeepOurs) signature and body unchanged so the code
relies on the self-describing function name instead of the inline comment.

Source: Coding guidelines


82-82: ⚡ Quick win

Remove implementation comment per coding guidelines.

The function name and boolean return type convey the meaning.

♻️ Suggested diff
-// true when `ancestor` is reachable from `descendant` (nothing to sync)
 export async function isAncestor(ancestor: string, descendant: string): Promise<boolean> {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/release-action/src/gitUtils.ts` at line 82, Remove the
implementation comment "// true when `ancestor` is reachable from `descendant`
(nothing to sync)" that sits above the boolean-returning reachability function
(the function that checks if an ancestor is reachable from a descendant); the
function name and its boolean return type already convey the meaning so simply
delete that comment to comply with the coding guidelines.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/develop-sync.yml:
- Around line 23-26: Add persist-credentials: false to the actions/checkout step
to avoid exposing the CI_PAT to later steps; update the checkout usage in the
workflow (the actions/checkout invocation shown) and ensure subsequent git
operations in the "Sync develop with master" step explicitly use the token from
the environment (e.g., the CI_PAT secret) rather than relying on persisted
credentials.

In `@packages/release-action/src/gitUtils.ts`:
- Around line 49-50: Remove the redundant implementation comment above the merge
helper in gitUtils.ts (the two-line comment starting "// start a merge..." and
"// returns true...") because the function signature/return type already
document its behavior; locate the comment near the merge helper function (e.g.,
the function that returns a boolean indicating whether the merge applied
cleanly) and delete those lines to comply with the coding guidelines.
- Around line 44-45: Remove the inline implementation comment above the function
declaration for resetBranchTo; the function name and signature already convey
intent, so delete the comment line "// reset/create a local branch pointing at
the given ref (e.g. origin/develop)" directly above the export async function
resetBranchTo(branch: string, ref: string) declaration to comply with the
TypeScript coding guideline to avoid implementation comments.
- Line 95: Remove the redundant implementation comment "// contents of a file
(e.g. origin/master:package.json) or merge stage (e.g. :2:CHANGELOG.md)" which
simply restates the function behavior; leave the surrounding code and function
signature unchanged so the function (the one that returns file contents at a
ref/merge stage) remains self-documenting without the comment.
- Line 69: Remove the implementation comment "// resolve a conflicted file by
keeping our side (the branch we merge into)" that sits above the
conflict-resolution function; per guidelines, delete this descriptive
implementation comment and leave the function (resolveConflictKeepOurs)
signature and body unchanged so the code relies on the self-describing function
name instead of the inline comment.
- Line 82: Remove the implementation comment "// true when `ancestor` is
reachable from `descendant` (nothing to sync)" that sits above the
boolean-returning reachability function (the function that checks if an ancestor
is reachable from a descendant); the function name and its boolean return type
already convey the meaning so simply delete that comment to comply with the
coding guidelines.

In `@packages/release-action/src/syncDevelop.ts`:
- Line 93: Delete the implementation comment "// the non-package.json version
files (e.g. apps/meteor/app/utils/rocketchat.info)" above the extraVersionFiles
filter; the variable name extraVersionFiles and its filter operation are
self-explanatory, so remove that stray comment to comply with coding guidelines.
- Around line 26-28: Remove the surrounding explanatory comment above the
TITLE_PREFIX constant: the name TITLE_PREFIX and its value 'chore: sync develop
with master' are self-describing, so delete the multi-line implementation
comment and leave only the constant declaration (refer to TITLE_PREFIX in
syncDevelop.ts) to comply with coding guidelines.
- Around line 60-62: Remove the implementation comment block that documents
behavior above the unionMergeChangelog function; the function name
unionMergeChangelog and the git command arguments already express the behavior,
so delete the three-line explanatory comment (about resolving conflicted
CHANGELOG.md with a lossless union and opening a review PR) to comply with
coding guidelines and keep the source concise.
- Line 207: Remove the implementation comment "// auto-merge may be disabled on
the repo or the PR may already be mergeable; don't fail the sync" from the catch
block in syncDevelop.ts; leave the existing warning log message intact (do not
change the catch logic or logging), so only delete that explanatory inline
comment per coding guidelines.
- Line 96: Remove the redundant implementation comment "// branch off develop,
then merge master into it" from the code (it's purely descriptive of the
following git operations). Delete that single-line comment in syncDevelop.ts so
the code follows the guideline of avoiding implementation comments; no code
changes besides removing that comment are needed.
- Line 88: Remove the implementation comment "// the released version, read from
master's root package.json — used for titles" above the version variable; locate
the declaration named version (where JSON.parse is used to read package.json)
and delete that comment so the code follows the guideline that the variable name
and JSON parsing are self-descriptive.
- Line 146: Remove the redundant implementation comment "// Tier 1: only version
lines conflicted (or a clean merge) → safe to auto-merge." in syncDevelop.ts;
the behavior is already documented by the subsequent ensurePullRequest call that
passes autoMerge: true, so just delete that comment and leave the
ensurePullRequest(...) invocation and its autoMerge flag unchanged.
- Around line 103-104: Remove the implementation-only comment "Tier 3: real code
conflicts — we can't safely resolve. Open a manual PR with master as-is so a
human resolves everything in the PR." from syncDevelop
(packages/release-action/src/syncDevelop.ts) — delete those lines so the code
contains only the condition, warning message, and operations themselves,
aligning with the coding guideline to avoid implementation comments.
- Line 122: Remove the implementation-only comment "// resolve the predictable
conflicts: version lines keep develop's side" from
packages/release-action/src/syncDevelop.ts (it is an implementation detail
comment in the sync logic); simply delete that line so the code contains no
explanatory implementation comment while leaving the surrounding logic and any
conflict-resolution behavior in the syncDevelop function intact.
- Line 134: Remove the inline implementation comment above the tier-2 branch
(the comment starting with "Tier 2: changelog conflicts were auto-resolved but
ordering needs review → no auto-merge.") — delete that comment and leave the
existing condition and function call handling the tier-2 case untouched, since
the condition and invocation already make the behavior clear.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4007af42-8517-4350-8d45-007c12acf71b

📥 Commits

Reviewing files that changed from the base of the PR and between 3a72f99 and 49fa221.

📒 Files selected for processing (6)
  • .github/workflows/develop-sync.yml
  • packages/release-action/action.yml
  • packages/release-action/src/gitUtils.ts
  • packages/release-action/src/index.ts
  • packages/release-action/src/syncDevelop.ts
  • packages/release-action/src/utils.ts
📜 Review details
⏰ 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: Hacktron Security Check
  • GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • packages/release-action/src/utils.ts
  • packages/release-action/src/index.ts
  • packages/release-action/src/gitUtils.ts
  • packages/release-action/src/syncDevelop.ts
🧠 Learnings (3)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • packages/release-action/src/utils.ts
  • packages/release-action/src/index.ts
  • packages/release-action/src/gitUtils.ts
  • packages/release-action/src/syncDevelop.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • packages/release-action/src/utils.ts
  • packages/release-action/src/index.ts
  • packages/release-action/src/gitUtils.ts
  • packages/release-action/src/syncDevelop.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • packages/release-action/src/utils.ts
  • packages/release-action/src/index.ts
  • packages/release-action/src/gitUtils.ts
  • packages/release-action/src/syncDevelop.ts
🪛 zizmor (1.25.2)
.github/workflows/develop-sync.yml

[warning] 22-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 6-9: use of fundamentally insecure workflow trigger (dangerous-triggers): workflow_run is almost always used insecurely

(dangerous-triggers)

🔇 Additional comments (8)
packages/release-action/src/syncDevelop.ts (3)

40-58: LGTM!


156-194: LGTM!


212-240: LGTM!

packages/release-action/src/utils.ts (1)

69-69: LGTM!

packages/release-action/src/index.ts (1)

10-10: LGTM!

Also applies to: 52-53

packages/release-action/action.yml (1)

6-6: LGTM!

.github/workflows/develop-sync.yml (2)

35-43: LGTM!


6-19: Limit workflow_run attacker scope: ensure no workflow_run artifacts/payload are consumed by the called action

Publish Final Release is defined in .github/workflows/publish-release.yml with on: push: branches: [master], so develop-sync.yml’s workflow_run can only be triggered from runs of that workflow on master, and develop-sync.yml further gates execution on github.event.workflow_run.conclusion == 'success'.

Still, the security claim that this trigger path doesn’t consume any workflow_run artifacts/payload can’t be concluded from the develop-sync.yml snippet alone—inspect ./packages/release-action (used by develop-sync.yml with action: sync-develop) for any actions/download-artifact usage or reads of github.event.workflow_run.*.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 6 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Pull requests that introduces new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant