Skip to content

fix: reuse single Manifest instance for releases and pull requests#1189

Open
sehawq wants to merge 1 commit intogoogleapis:mainfrom
sehawq:fix/reuse-manifest-instance
Open

fix: reuse single Manifest instance for releases and pull requests#1189
sehawq wants to merge 1 commit intogoogleapis:mainfrom
sehawq:fix/reuse-manifest-instance

Conversation

@sehawq
Copy link

@sehawq sehawq commented Feb 26, 2026

The main() function previously instantiated two separate Manifest objects: one for creating releases and another for creating pull requests. Each call to loadOrBuildManifest() triggered GitHub API requests to fetch repository configuration and release history.

When draft: true is enabled, this redundancy becomes especially costly because draft release resolution requires iterating through more GitHub API pages to find tagged releases, effectively doubling the API overhead.

This PR hoists the loadOrBuildManifest() call above both conditional blocks so a single, shared instance is used for both operations.

Fixes #1169

The main() function was creating two separate Manifest instances - one
for creating releases and one for creating pull requests. Each call to
loadOrBuildManifest() triggers GitHub API requests to fetch repository
config and release history.

This is especially costly when draft releases are enabled because draft
release resolution requires iterating through more GitHub API pages to
find tagged releases, effectively doubling the API overhead.

Hoist the loadOrBuildManifest() call above both conditional blocks so a
single instance is shared across both operations.

Fixes googleapis#1169
@google-cla
Copy link

google-cla bot commented Feb 26, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

draft: true causes performance regression in action execution time

1 participant