Skip to content

fix(github-actions): resolve pending mergeability checks on LTS branches#3714

Merged
josephperrott merged 1 commit into
angular:mainfrom
alan-agius4:lts-fix
Jun 1, 2026
Merged

fix(github-actions): resolve pending mergeability checks on LTS branches#3714
josephperrott merged 1 commit into
angular:mainfrom
alan-agius4:lts-fix

Conversation

@alan-agius4
Copy link
Copy Markdown
Contributor

The branch-manager local GitHub Action previously relied on a mocked minimal configuration which lacked the "release" configuration block. As a result, validations checking the TARGET_LTS target label failed because they could not determine active LTS branches (which requires release config settings). This caused LTS PRs to throw an InvalidTargetLabelError and remain in a "pending" status permanently.

This change fixes the issue by dynamically importing the actual repository's .ng-dev/config.mjs configuration after the repository is cloned inside the local action workspace, merging it with action input overrides and re-caching it.

We also update setCachedConfig to support clearing/overwriting the cache by allowing null values.

@alan-agius4 alan-agius4 requested a review from josephperrott May 29, 2026 12:05
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label May 29, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the branch manager local action by wrapping the execution logic inside an async main function, improving configuration loading and validation, and ensuring proper token revocation in a finally block. It also updates setCachedConfig to accept null. The review comments identify a critical issue where using the nullish coalescing operator (??=) on sha will fail to fall back when the input is an empty string, and suggest removing a redundant check for token !== undefined in the finally block.

Comment thread .github/local-actions/branch-manager/lib/main.ts Outdated
Comment thread .github/local-actions/branch-manager/lib/main.ts Outdated
@alan-agius4 alan-agius4 force-pushed the lts-fix branch 4 times, most recently from 1aabecb to 3c1c489 Compare May 29, 2026 12:16
Copy link
Copy Markdown
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

Just one comment I want to make sure we have checked about loading the config from the environment locally.

await cloneRepoIntoTmpLocation({owner, repo});

// Remove cached config and use the repo config.
// TODO(alanagius): this is needed because `setupConfigAndGitClient` uses a dummy config.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have we verified this will work even if the config is defined using a typescript files? I know we have tried to do this in the past and found it didn't work in all locations with the changes we tried to make.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought we migrate those, but looks like components are still using typescript configs.

We can either migrate that, or keep the dummy config if config is in typescript format.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm fine with either, I think we just need to make sure that we don't get into a failing state with the change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I went with not failing of the config is not found.

The branch-manager local GitHub Action previously relied on a mocked minimal configuration which lacked the "release" configuration block.

As a result, validations checking the `TARGET_LTS` target label failed because they could not determine active LTS branches (which requires release config settings). This caused LTS PRs to throw an `InvalidTargetLabelError` and remain in a "pending" status permanently.

This change fixes the issue by dynamically importing the actual repository's `.ng-dev/config.mjs` configuration after the repository is cloned inside the local action workspace, merging it with action input overrides and re-caching it.

We also update `setCachedConfig` to support clearing/overwriting the cache by allowing `null` values.
Copy link
Copy Markdown
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@josephperrott josephperrott merged commit df2b39e into angular:main Jun 1, 2026
16 checks passed
@josephperrott
Copy link
Copy Markdown
Member

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4 alan-agius4 deleted the lts-fix branch June 1, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants