Skip to content

Comments

feat: docker and command type for webhooks #18

Merged
vigneshrajsb merged 3 commits intoGoodRxOSS:mainfrom
vigneshrajsb:extend-webhooks
Jul 7, 2025
Merged

feat: docker and command type for webhooks #18
vigneshrajsb merged 3 commits intoGoodRxOSS:mainfrom
vigneshrajsb:extend-webhooks

Conversation

@vigneshrajsb
Copy link
Contributor

@vigneshrajsb vigneshrajsb commented Jul 4, 2025

What

While codefresh integrated webhook is good to have, we want to have other options to be able to run webhooks.

With extending webhook types to docker and command type, we can use this run several scenarios from slack notifications to executing other CI builds as needed.

Examples

Docker Type Webhook

webhooks:
  - name: "Run tests"
    description: "Execute test suite in custom container"
    state: "deployed"
    type: "docker"
    docker:
      image: "myorg/smoke-tests:v1.2.3"
      command: ["/bin/sh", "-c"]
      args: ["npm run smoke-tests"]
      env:
        API_URL: "https://{{{<service_name>_publicUrl}}}"
        NAMESPACE: "{{{namespace}}}"
      timeout: 1800  # seconds (30 minutes), optional

Command Type Webhook (Simplified)

webhooks:
  - name: "Notify Slack"
    description: "Send deployment error notification to Slack"
    state: "error"
    type: "command"
    command:
      image: "curlimages/curl:latest"
      script: |
        curl -X POST https://hooks.slack.com/services/XXX/YYY/ZZZ \
          -H 'Content-type: application/json' \
          -d '{"text":"Deployment {{uuid}} errored for branch {{branch}}"}'
      env:
        DEPLOY_UUID: "{{buildUUID}}"

History view

Empty state

image

With invocations

image

Missing features

  • No webhooks logs streaming while the job is in progress (needs more refactoring on how the jobs are created and executed to get the job name)
  • Webhook executions are fire and forget, it has no impact on the build status
  • History limited to last 20 invocations
  • Additive change to schema, no new versions created

Pending

  • update docs if this is approved

PS: codefresh type webhook is still supported and has the same schema. CODEFRESH_API_KEY env var should be set in the worker deployment for this webhooks to work as expected

feat: minor changes to webhook extensions

feat: simplify job metadata

remove unused api for now
@vigneshrajsb vigneshrajsb requested a review from a team as a code owner July 4, 2025 06:37
webhook pod logs UI

ui fixes

remove file
@vigneshrajsb vigneshrajsb changed the title feat: docker && command webhooks support feat: docker and command type for webhooks Jul 4, 2025
@vigneshrajsb vigneshrajsb merged commit 5d8bd2c into GoodRxOSS:main Jul 7, 2025
1 check passed
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.

2 participants