nebari-dev / nebari-dev/harbor-pack
Provision project webhook policies from values
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 1
- Forks
- 0
- Avg merge
- 2h 34m
- Merged PRs (30d)
- 4
Description
Problem
Downstream systems that index or mirror what lands in Harbor need change notification. Harbor has webhook policies for this (PUSH_ARTIFACT, DELETE_ARTIFACT, TAG_RETENTION, SCANNING_*, etc., with Default or CloudEvents payloads), but they are per-project DB state configured in the UI today. They do not survive a fresh install, and the consumer's endpoint URL and shared auth header end up in nobody's version control.
Proposal
Add bootstrap.webhooks[] applied from the post-install job introduced in #2:
bootstrap:
webhooks:
- project: cogs
name: collab-hub-cog-index
endpoint: https://collab-hub.example.com/cogs/registry-events
events: [PUSH_ARTIFACT, DELETE_ARTIFACT]
payloadFormat: Default # Default | CloudEvents
authHeader: # sent verbatim as the Authorization header
secretName: harbor-webhook-cog-index
secretKey: authorization
skipCertVerify: false
enabled: true
API surface: GET/POST /api/v2.0/projects/{name}/webhook/policies, PUT .../webhook/policies/{id}; GET /projects/{name}/webhook/events lists the supported event and notify types for validation.
Requirements
- Idempotent by
(project, name): create if absent, otherwisePUTso endpoint/event changes in values propagate onhelm upgrade. - The auth header value comes from a Secret, never from values.
- Validate
eventsagainst/webhook/eventsand fail the job with a clear message on a typo rather than silently creating a policy with no events. - Depends on #2 (project must exist).
Non-goals
Anything about what the receiving endpoint does with the payload. This issue is only about the registry declaring where to send events.
Acceptance
- Fresh
make up-ssowith a webhook entry creates the policy; pushing an artifact to the project delivers aPUSH_ARTIFACTpayload to the endpoint with the configured Authorization header. - Changing
endpointoreventsin values and runninghelm upgradeupdates the existing policy (no duplicates). - README values reference + docs.
Context
Motivated by nebari-dev/collab-hub-pack#7 (near-real-time indexing of cog pushes). Related: #2 (projects), #3 (robot provisioning).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the post-install job introduced in #2 and the Helm values used by make up-sso; inspect how project and robot provisioning are structured. Add webhook configuration, Secret-backed authorization, event validation, and idempotent updates through Harbor's webhook policy APIs. Verify fresh installation, helm upgrade changes without duplicates, artifact delivery, and the README values reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100