-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate workflow-plugin-github to strict gRPC proto contracts #6
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8b550dc
Initial plan
Copilot 10d5c65
Add strict gRPC proto contracts: stepSchemas in plugin.json + SchemaP…
Copilot c6e8d22
Add strict-contracts CI job, strengthen contract tests, add engine ma…
Copilot d3aba96
Address all 9 review thread comments: fix pr_merge method, release_up…
Copilot 5945a1b
Change CI runner to ubuntu-latest
intel352 1df7e69
Address remaining review comments: fix type/description issues, re-ad…
Copilot fcf3cd6
ci: add permissions: contents: read to test job to fix CodeQL finding
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| package internal | ||
|
|
||
| import sdk "github.com/GoCodeAlone/workflow/plugin/external/sdk" | ||
|
|
||
| // Ensure githubPlugin satisfies sdk.SchemaProvider at compile time. | ||
| var _ sdk.SchemaProvider = (*githubPlugin)(nil) | ||
|
|
||
| // ModuleSchemas returns schema descriptors for all module types provided by | ||
| // this plugin. Implementing sdk.SchemaProvider allows the engine to surface | ||
| // module configuration fields and I/O contracts at startup and in the UI. | ||
| func (p *githubPlugin) ModuleSchemas() []sdk.ModuleSchemaData { | ||
| return []sdk.ModuleSchemaData{ | ||
| { | ||
| Type: "git.webhook", | ||
| Label: "GitHub Webhook", | ||
| Category: "github", | ||
| Description: "Receives GitHub webhook events via HTTP, verifies HMAC-SHA256 signatures, and publishes normalised GitEvent messages to a configurable topic.", | ||
| ConfigFields: []sdk.ConfigField{ | ||
| { | ||
|
|
||
| Name: "provider", | ||
| Type: "string", | ||
| Description: "Webhook provider identifier. Accepted for backward compatibility; the module always publishes events with provider 'github'.", | ||
| DefaultValue: "github", | ||
| Required: false, | ||
| }, | ||
| { | ||
| Name: "secret", | ||
| Type: "string", | ||
| Description: "Webhook secret used to verify the X-Hub-Signature-256 header. Leave empty to skip signature verification.", | ||
| Required: false, | ||
| }, | ||
| { | ||
| Name: "events", | ||
| Type: "array", | ||
| Description: "Event types to accept (e.g. push, pull_request). An empty list accepts all event types.", | ||
| Required: false, | ||
| }, | ||
| { | ||
| Name: "topic", | ||
| Type: "string", | ||
| Description: "Message-bus topic to which normalised GitEvent payloads are published.", | ||
| DefaultValue: "git.events", | ||
| Required: false, | ||
| }, | ||
| }, | ||
| Outputs: []sdk.ServiceIO{ | ||
| {Name: "provider", Type: "string", Description: "Webhook provider (always 'github')"}, | ||
| {Name: "event_type", Type: "string", Description: "GitHub event type (e.g. push, pull_request)"}, | ||
| {Name: "repository", Type: "string", Description: "Repository full name (owner/repo)"}, | ||
| {Name: "branch", Type: "string", Description: "Branch or ref name"}, | ||
| {Name: "commit", Type: "string", Description: "Commit SHA"}, | ||
| {Name: "author", Type: "string", Description: "Event author username"}, | ||
| {Name: "message", Type: "string", Description: "Commit message or PR title"}, | ||
| {Name: "url", Type: "string", Description: "URL to the commit or PR"}, | ||
| {Name: "raw_payload", Type: "object", Description: "Raw JSON webhook payload"}, | ||
| {Name: "timestamp", Type: "string", Description: "Event timestamp in RFC3339 format"}, | ||
| }, | ||
| }, | ||
| { | ||
| Type: "github.app", | ||
| Label: "GitHub App", | ||
| Category: "github", | ||
| Description: "Authenticates as a GitHub App installation, generating short-lived installation access tokens from an App private key. Tokens are cached and refreshed automatically.", | ||
| ConfigFields: []sdk.ConfigField{ | ||
| { | ||
| Name: "app_id", | ||
| Type: "number", | ||
| Description: "GitHub App ID", | ||
| Required: true, | ||
| }, | ||
| { | ||
| Name: "installation_id", | ||
| Type: "number", | ||
| Description: "GitHub App installation ID", | ||
| Required: true, | ||
| }, | ||
| { | ||
| Name: "private_key", | ||
| Type: "string", | ||
| Description: "PEM-encoded RSA private key for the GitHub App (supports env var references e.g. ${GITHUB_APP_PRIVATE_KEY})", | ||
| Required: true, | ||
| }, | ||
| }, | ||
| }, | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.