Skip to content

fix: add missing repository selector to DefaultBranch resource#232

Open
jackivanov wants to merge 1 commit intocrossplane-contrib:mainfrom
jackivanov:fix/defaultbranch-repository-selector
Open

fix: add missing repository selector to DefaultBranch resource#232
jackivanov wants to merge 1 commit intocrossplane-contrib:mainfrom
jackivanov:fix/defaultbranch-repository-selector

Conversation

@jackivanov
Copy link
Contributor

@jackivanov jackivanov commented Oct 2, 2025

Description of your changes

The DefaultBranch resource was missing repository field, repositoryRef, and repositorySelector due to incorrect external name configuration. Changed from config.TemplatedStringAsIdentifier to config.IdentifierFromProvider to match the pattern used by other repository-related resources.

This change:

  • Adds repository field for direct repository name input
  • Adds repositoryRef for cross-resource references
  • Adds repositorySelector for label-based repository selection
  • Maintains backward compatibility with existing resources
  • Follows the established pattern used by other repo resources

Fixes #84

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

make reviewable test

The DefaultBranch resource was missing repository field, repositoryRef, and
repositorySelector due to incorrect external name configuration. Changed from
config.TemplatedStringAsIdentifier to config.IdentifierFromProvider to match
the pattern used by other repository-related resources.

This change:
- Adds repository field for direct repository name input
- Adds repositoryRef for cross-resource references
- Adds repositorySelector for label-based repository selection
- Maintains backward compatibility with existing resources
- Follows the established pattern used by other repo resources

Fixes crossplane-contrib#84

Signed-off-by: Jack Ivanov <17044561+jackivanov@users.noreply.github.com>
@jackivanov jackivanov force-pushed the fix/defaultbranch-repository-selector branch from 35d133a to 6ca9efe Compare October 2, 2025 18:47
@jackivanov
Copy link
Contributor Author

Hi @AtzeDeVries, Could you please review, merge, and release a new version? We rely on this resource in our enterprise. Much appreciated.

@jackivanov
Copy link
Contributor Author

Sorry for pinging you @pravindahal @xunholy. Highly appreciate if you can review, merge and release. Thanks!

"github_branch": config.IdentifierFromProvider,
// Imported by using the following format: {{ repository }}
"github_branch_default": config.TemplatedStringAsIdentifier("repository", "{{ .external_name }}"),
"github_branch_default": config.IdentifierFromProvider,
Copy link
Collaborator

@AtzeDeVries AtzeDeVries Oct 7, 2025

Choose a reason for hiding this comment

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

@jackivanov let me verify this, but i believe this might be a breaking change.

First of all, if the format of the external does not change then this is ok.

If the format of the external name changes then this will change how the provider interprets the external name on current resources. I am not aware of upjet beging able to handle this, but could be

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.

defaultBranch provider doesnt have the ability to select a repository

2 participants