Skip to content

Conversation

@cbullinger
Copy link
Collaborator

Includes all the fixes needed to get the copier app to work in the monorepo:

  • Added GetRestClientForOrg() for org-specific authentication
  • Fixed GraphQL query to use node(id:) instead of repository(owner:)
  • Updated file content retrieval to use org-specific client
  • Removed the refs/heads/ prefix duplication

The workflow processor was creating UploadKey with BranchPath set to just
the branch name (e.g., 'main') instead of the full ref path (e.g.,
'refs/heads/main'). This caused GitHub API calls to fail with 404 errors
when trying to access the branch ref.

This fix ensures BranchPath is always set with the 'refs/heads/' prefix,
consistent with how it's used throughout the rest of the codebase.
- Add GetRestClientForOrg() to get installation-specific tokens
- Fix GraphQL query to use node(id:) instead of repository(owner:)
- Update RetrieveFileContentsWithConfigAndBranch to use org-specific client
- Remove refs/heads/ prefix duplication in workflow processor
- Fixes 404 errors when accessing repos in different orgs
- Add explicit 'GITHUB APP AUTHENTICATION FAILED' message for 401 errors
- Point users to check CODE_COPIER_PEM secret in GCP Secret Manager
- Add detection in getInstallationIDForOrg, getInstallationAccessToken
- Add detection in config_loader and main_config_loader when fetching configs

This makes it immediately obvious when the PEM key is invalid/expired
instead of showing misleading 'failed to load config' errors.
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.

1 participant