Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a ReconcileEntityRegistration method to the Providers API and a reconcile repository implementation to the GitHub App #3268

Open
jhrozek opened this issue May 7, 2024 · 0 comments

Comments

@jhrozek
Copy link
Contributor

jhrozek commented May 7, 2024

In order to trigger repository reconciliation to either cover the case where we miss a webhook or after the initial enablement of the auto-enrollment we need a way to tell the provider to reconcile the auto-registered repositories with the upstream repositories.

To do that, we'd extend the providers API with an ReconcileEntityRegistration method exposed as an RPC. The Github app provider would implement it to reconcile repositories.

The RPC might look like this:

rpc ReconcileEntityRegistration (ReconcileEntityRegistrationRequest) returns (ReconcileEntityRegistrationResponse) {
        option (google.api.http) = {
            post: "/api/v1/repository/provider/{provider}/register_all"
            additional_bindings {
                post: "/api/v1/repository/register_all",
                body: "*"
            }
            body: "*"
        };

        option (rpc_options) = {
            target_resource: TARGET_RESOURCE_PROJECT
	     // TODO: ensure that we either have per-entity APIs or we have a relation that allows any entity
            relation: RELATION_REPO_CREATE
        };
    }

message ReconcileEntityRegistrationRequest {
    Context context = 1;
    Entity entity = 2; // reconcile this entity type only
}

message RegisterRepositoryResponse {
	// empty by design
}

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

No branches or pull requests

1 participant