Repository navigation
feat: make the chart deployable on OpenShift - #43
Conversation
Inserting shared mock data into a collection adds an `_id`, and later tests couldn't serialize it. Two more tests lacked an app context. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replaces Travis and `main.yaml`. Tests run in the image. The smoke test uses MongoDB 7, which needs a newer pymongo than FOCA 0.7 pins. Excludes `.env*` from the image build context. Closes #32 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each call has a timeout and follows no redirects. A failure stays with its subscriber, and other than 2xx counts as one. The build stores one result per subscriber, without URLs or tokens. Closes #34 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With builds off, the default, the POST takes one prebuilt image and notifies subscribers. Build requests and PUT get a 403. Registration can be closed by configuration, and a subscription value `*` matches any tag or branch, as registering again won't work then. Closes #33 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Configuration from a Secret, and defaults in the image with no users and no debug mode. Without builds, no updater, shared volume, or rights. Route or Ingress with TLS, ClusterIP services with own selectors, no fixed user IDs, MongoDB 7 and camelCase values. The image runs under any user ID. Closes #35 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Admin users follow the configuration, the probe avoids the database, the build path finds its own namespace, and the README covers moving from the old chart. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shared thread limit let calls that hang keep later subscribers in the queue until the overall wait ended, so these were never called. Each subscriber now gets a thread, and the setting `endpoints.subscriptions.max_per_repository` (default: 100) limits the number of subscriptions per repository, and with it the threads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ages # Conflicts: # pubgrade/errors/exceptions.py # pubgrade/modules/endpoints/subscriptions.py # tests/pubgrade/endpoints/test_subscriptions.py
# Conflicts: # pubgrade/config.yaml
Reviewer's GuideThe PR upgrades Pubgrade’s deployment and runtime model for Kubernetes and OpenShift: a v2 Helm chart now supports arbitrary namespaces and user IDs, conditional Routes/Ingresses, NetworkPolicy, Secret-based configuration, and opt-in build infrastructure; the application adds secure defaults, admin reconciliation, prebuilt-image publishing, bounded concurrent notifications, and registration controls; CI, smoke/render tests, Docker packaging, API documentation, and installation guidance are updated accordingly. Sequence diagram for prebuilt-image publishing and notificationssequenceDiagram
participant CI
participant API
participant MongoDB
participant Subscribers
CI->>API: POST /repositories/{repo_id}/builds
API->>API: validate_prebuilt_image
API->>MongoDB: insert build
API->>Subscribers: notify_all_subscriptions
Subscribers->>Subscribers: notify_subscriptions
Subscribers-->>API: notification results
API->>MongoDB: update build notifications and status
API-->>CI: build id
Sequence diagram for configuration-driven admin reconciliationsequenceDiagram
participant Pubgrade
participant ConfigSecret
participant MongoDB
Pubgrade->>ConfigSecret: load config.yaml
Pubgrade->>MongoDB: replace_one admin users
Pubgrade->>MongoDB: delete_many removed admin users
MongoDB-->>Pubgrade: reconciled admin users
Flow diagram for optional Pubgrade build infrastructureflowchart LR
Values[builds.enabled]
Pubgrade[Pubgrade]
Updater[Updater]
BuildPods[Build Pods]
BuildVolume[Shared Build Volume]
RBAC[ServiceAccount and namespace RBAC]
Values -->|enabled| Pubgrade
Pubgrade -->|creates/manages| BuildPods
Pubgrade -->|uses| BuildVolume
Updater -->|processes builds| BuildPods
Pubgrade -->|uses| RBAC
Updater -->|uses| RBAC
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 9 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="helm/templates/mongodb/deployment.yaml" line_range="21" />
<code_context>
+ automountServiceAccountToken: false
+ containers:
+ - name: mongodb
+ image: {{ .Values.mongodb.image | quote }}
+ imagePullPolicy: {{ .Values.mongodb.imagePullPolicy }}
+ ports:
</code_context>
<issue_to_address>
**PVC-mounted directories stay unwritable**
When openShift assigns MongoDB an arbitrary UID or the storage class provisions PVCs without write access for the container user, the PVC mounts hide the image directories’ writable permissions, so MongoDB cannot start and builds cannot clone their source.
Set permissions on both PVC mounts so the MongoDB and Pubgrade container users can write.
Also at `helm/templates/mongodb/deployment.yaml:30-32`, `helm/templates/pubgrade/deployment.yaml:84-85`.
</issue_to_address>
### Comment 2
<location path="pubgrade/modules/endpoints/subscriptions.py" line_range="346" />
<code_context>
+ response = requests.request(
+ "PUT",
+ subscription_object["callback_url"],
+ headers={
+ "X-Access-Token": subscription_object["access_token"],
+ "Content-Type": "application/json",
</code_context>
<issue_to_address>
**Callback credentials cross plaintext networks**
When a subscriber registers an HTTP callback URL, `notify_subscriptions` sends `subscription_object["access_token"]` in the `X-Access-Token` header even when the callback URL uses HTTP, so an on-path observer can capture the credential and impersonate the deployment callback.
Require HTTPS callback URLs, or provide a narrowly scoped explicit opt-in for trusted HTTP destinations that do not carry credentials in plaintext.
</issue_to_address>
### Comment 3
<location path="pubgrade/modules/endpoints/subscriptions.py" line_range="344" />
<code_context>
+ # No redirects, as they would forward the token to another host. Only
+ # the status counts: the body isn't read
+ response = requests.request(
+ "PUT",
+ subscription_object["callback_url"],
+ headers={
</code_context>
<issue_to_address>
**Notifications can reach internal services**
When a verified user registers a subscription whose callback URL targets an internal HTTP service and a matching build is published, `notify_subscriptions` sends a PUT to the stored `callback_url` without restricting its host or IP, so a verified subscriber can make Pubgrade send requests to cluster-local services when a matching image is published.
Restrict callback destinations to approved public hosts and reject loopback, private, link-local, and other internal IP ranges after DNS resolution, including redirects and rebinding cases.
</issue_to_address>
### Comment 4
<location path="helm/templates/pubgrade/role.yaml" line_range="8-9" />
<code_context>
- name: role-pubgrade
-rules:
-- apiGroups: [""]
- resources: ["pods", "services"]
- verbs: ["get", "list", "watch", "create", "update", "delete"]
</code_context>
<issue_to_address>
**Build role can rewrite Services**
When `builds.enabled` is true and either component is compromised or otherwise misused, the shared Pubgrade service account grants both Pubgrade and the updater create, update, and delete access to every Service in the namespace, although the build paths only create, list, and delete Pods. A compromised component can redirect or disrupt unrelated Service traffic.
Grant only the Pod permissions required by the build and updater paths, and remove `services` from the Role unless a concrete Service operation is added.
</issue_to_address>
### Comment 5
<location path="helm/templates/mongodb/deployment.yaml" line_range="25" />
<code_context>
+ imagePullPolicy: {{ .Values.mongodb.imagePullPolicy }}
+ ports:
+ - name: mongodb
+ containerPort: {{ .Values.mongodb.port }}
+ {{- with .Values.mongodb.resources }}
+ resources:
</code_context>
<issue_to_address>
**MongoDB listens on the default port**
When `.Values.mongodb.port` is set to anything other than MongoDB’s default port, the chart changes the declared container and Service ports and Pubgrade’s connection port, but the MongoDB process still listens on its default port, so Pubgrade cannot connect.
Configure MongoDB to listen on the configured port, or keep the chart’s MongoDB port fixed at the default.
Also at `helm/templates/pubgrade/deployment.yaml:43`.
</issue_to_address>
### Comment 6
<location path="helm/templates/pubgrade/deployment.yaml" line_range="29-32" />
<code_context>
+ ports:
+ - name: http
+ containerPort: {{ .Values.pubgrade.port }}
+ readinessProbe:
+ httpGet:
+ path: /ui/
+ port: http
+ periodSeconds: 10
+ {{- with .Values.pubgrade.resources }}
</code_context>
<issue_to_address>
**Requests reach app while database is unavailable**
When mongoDB is unavailable during startup or an outage, the `/ui/` probe succeeds without checking MongoDB, so Kubernetes keeps Pubgrade ready and routes requests to it while MongoDB is down or still starting. Database-backed operations then fail for clients instead of the pod being held out of service.
Use a readiness check that verifies Pubgrade can access MongoDB, and add a readiness probe for MongoDB.
</issue_to_address>
### Comment 7
<location path="helm/templates/pubgrade/pvc.yaml" line_range="7-14" />
<code_context>
+metadata:
+ name: pubgrade-builds
+spec:
+ {{- with .Values.builds.volume.storageClass }}
+ storageClassName: {{ . }}
+ {{- end }}
+ accessModes:
+ - ReadWriteMany
+ resources:
+ requests:
+ storage: {{ .Values.builds.volume.size }}
+{{- end }}
</code_context>
<issue_to_address>
**Builds stall on RWO storage**
When `builds.enabled` is true and the cluster's default StorageClass does not support `ReadWriteMany`, the PVC requests `ReadWriteMany`, so a default StorageClass that supports only `ReadWriteOnce` cannot provision it. The Pubgrade pod and build pods then remain unable to mount the shared volume, and builds never run.
Make the RWX-capable StorageClass requirement explicit in the build configuration and documentation, and ensure builds cannot be enabled with a class that cannot provision this claim.
</issue_to_address>
### Comment 8
<location path="pubgrade/modules/endpoints/subscriptions.py" line_range="104-108" />
<code_context>
if data_from_db_repository is None:
raise RepositoryNotFound
+ if db_collection_subscriptions.count_documents(
+ {"repository_id": data["repository_id"]}
+ ) >= current_app.config["FOCA"].endpoints["subscriptions"].get(
+ "max_per_repository", DEFAULT_MAX_SUBSCRIPTIONS
+ ):
+ raise TooManySubscriptions
for i in range(retries):
logger.debug(f"Trying to insert/update object: try {i}" + str(data))
</code_context>
<issue_to_address>
**Concurrent registrations exceed the limit**
When multiple requests register subscriptions for the same repository concurrently near its configured limit, `register_subscription` checks the count before inserting without atomic enforcement, so concurrent requests can both pass and exceed `max_per_repository`; `notify_all_subscriptions` can then create more notification threads than the limit is meant to bound.
Enforce the per-repository limit atomically with subscription registration.
</issue_to_address>
### Comment 9
<location path="pubgrade/modules/endpoints/subscriptions.py" line_range="420" />
<code_context>
+
+ results: List[Dict[str, Any]] = []
+ if subscription_ids:
+ executor = ThreadPoolExecutor(max_workers=len(subscription_ids))
+ futures = {
+ executor.submit(notify, subscription_id): subscription_id
</code_context>
<issue_to_address>
**Deleted subscriptions still spawn threads**
When a repository accumulates deleted subscriptions through repeated registrations and deletions, `register_subscription` leaves each ID in the repository’s `subscription_list`, while `delete_subscription` and `delete_user` remove only subscription documents. `notify_all_subscriptions` sizes its thread pool from that unpruned list, so repeated register/delete cycles bypass the configured limit and eventually create excessive threads and skipped notification records for deleted subscriptions.
Remove deleted subscription IDs from the user and repository lists, and ensure notification work is bounded by live subscriptions.
Also at `pubgrade/modules/endpoints/subscriptions.py:104-108`.
</issue_to_address>Linked issues
#35 feat: make the chart deployable on OpenShift · 10 of 11 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Configuration from a Secret; safe default configuration and updated documentation | ✅ Met | The chart can mount an existing configuration Secret, the image defaults to no admin users and production settings, and the README explains creating the Secret and restarting Pubgrade after changes. |
| 2 | With builds off, no updater, shared volume, Role, or build Secret | ✅ Met | The build resources and credentials are conditional on builds.enabled; tests/chart.sh checks the default rendering omits them. |
| 3 | Org-owned images and a supported MongoDB version by default | ✅ Met | The chart defaults to elixircloud images and mongo:7.0. |
| 4 | Choose between Ingress and Route by value or cluster type, with TLS on both | ✅ Met | The chart creates a Route when the API is available unless Ingress is enabled; it configures edge TLS for Routes and cert-manager TLS for Ingress. |
| 5 | ClusterIP services, each selecting only its own pods | ✅ Met | Both Services are ClusterIP and use component-specific selectors. |
| 6 | No fixed user IDs; the image runs under an arbitrary user ID in group 0 | ✅ Met | The chart does not set runAsUser, the image makes its writable paths group-writable, and the smoke test runs it as 12345:0. |
| 7 | Values follow Helm naming conventions (camelCase) | ✅ Met | The chart values use camelCase names such as hostName, configSecret, and storageClass. |
| 8 | Chart tests in CI using rendered variants | ✅ Met | The CI Chart job runs tests/chart.sh, which renders and checks the default, OpenShift, Ingress, Secret, and builds variants. |
| 9 | Install on a local cluster with default values plus a config Secret, and confirm the API responds | 👀 Check by hand (runtime) | The PR description reports this was tested on a local k3s cluster; a person must verify that install and API response against a running cluster. |
| 10 | No personal registry references in the chart, Makefile, and docs | ✅ Met | The chart defaults, Makefile image names, and README contain no personal registry references. |
| 11 | Deploy into any namespace without special rights | ✅ Met | Resources use the Helm release namespace, and the default build-disabled deployment does not create service-account rights or a Role. |
Sourcery assessment
Needs a human reviewer. 9 findings to address first, and moving an existing chart 0.1 installation to this chart requires removing and reinstalling it, and the old MongoDB volume and its repository, user, and subscription data will not carry over; reverting the chart cannot restore that data. Publishing a prebuilt image also sends callbacks that may trigger deployments, so an incorrect publication can have effects outside Pubgrade that a revert cannot recall.
Blocking findings: helm/templates/mongodb/deployment.yaml:21, pubgrade/modules/endpoints/subscriptions.py:346, pubgrade/modules/endpoints/subscriptions.py:344, helm/templates/pubgrade/role.yaml:9, helm/templates/mongodb/deployment.yaml:25, and 4 more
There was a problem hiding this comment.
Hey - I've found 9 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="pubgrade/app.py" line_range="31-42" />
<code_context>
- .db.dbs["pubgradeStore"]
- .collections["admin_users"]
- .client
+ db_collection.replace_one(
+ {"uid": user["uid"]},
+ {
+ "uid": user["uid"],
+ "name": user["name"],
+ "user_access_token": user["user_access_token"],
+ },
+ upsert=True,
)
- data = db_collection.find({"uid": uid})
- if data.count() == 0:
</code_context>
<issue_to_address>
**Revoked admin tokens can persist**
When multiple app instances start concurrently against an empty admin collection while their mounted configurations contain different tokens for the same UID, `replace_one(..., upsert=True)` and the following `delete_many` are not an atomic reconciliation, and the collection has no unique constraint on `uid`. Concurrent startup with old and new admin configurations can upsert separate documents for the same UID; the deletion preserves both because the UID is still configured. `find_one` can then authenticate with the revoked token.
Enforce a unique index on admin UID and reconcile the configured admins atomically, or otherwise ensure only one instance performs the startup synchronization.
</issue_to_address>
### Comment 2
<location path="helm/templates/mongodb/deployment.yaml" line_range="25" />
<code_context>
+ imagePullPolicy: {{ .Values.mongodb.imagePullPolicy }}
+ ports:
+ - name: mongodb
+ containerPort: {{ .Values.mongodb.port }}
+ {{- with .Values.mongodb.resources }}
+ resources:
</code_context>
<issue_to_address>
**Custom MongoDB port breaks connections**
When `mongodb.port` is set to a value other than 27017, the templates set the container port, Service port, and `MONGO_PORT` from the same value, but the MongoDB image still listens on its default port 27017. Pubgrade therefore connects to a port with no listener, and the service is unavailable.
Either configure MongoDB to listen on `.Values.mongodb.port` or make the MongoDB listener port fixed and use that port consistently for the Service and Pubgrade connection.
Also at `helm/templates/mongodb/service.yaml:11`, `helm/templates/pubgrade/deployment.yaml:43`.
</issue_to_address>
### Comment 3
<location path="helm/templates/mongodb/deployment.yaml" line_range="21-32" />
<code_context>
+ automountServiceAccountToken: false
+ containers:
+ - name: mongodb
+ image: {{ .Values.mongodb.image | quote }}
+ imagePullPolicy: {{ .Values.mongodb.imagePullPolicy }}
+ ports:
+ - name: mongodb
+ containerPort: {{ .Values.mongodb.port }}
+ {{- with .Values.mongodb.resources }}
+ resources:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ volumeMounts:
+ - name: data
+ mountPath: /data/db
+ volumes:
+ - name: data
</code_context>
<issue_to_address>
**MongoDB fails to start**
When the chart is installed on OpenShift and the provisioned PVC is not writable by its assigned UID, `/data/db` is mounted without permissions compatible with the OpenShift-assigned UID, so MongoDB cannot initialize and Pubgrade has no database.
Prepare the mounted volume or configure compatible group permissions so MongoDB can write to `/data/db`.
</issue_to_address>
### Comment 4
<location path="helm/templates/pubgrade/deployment.yaml" line_range="31" />
<code_context>
+ containerPort: {{ .Values.pubgrade.port }}
+ readinessProbe:
+ httpGet:
+ path: /ui/
+ port: http
+ periodSeconds: 10
</code_context>
<issue_to_address>
**Database outage does not block traffic**
When mongoDB is starting or unavailable while Pubgrade can still serve `/ui/`, the `/ui/` probe can succeed while MongoDB is unavailable, so Kubernetes marks Pubgrade ready and routes API requests to it even though its database operations fail. This exposes failed requests during MongoDB startup or an outage.
Use a readiness check that verifies Pubgrade can reach MongoDB before allowing API traffic.
</issue_to_address>
### Comment 5
<location path="pubgrade/modules/endpoints/subscriptions.py" line_range="104-107" />
<code_context>
if data_from_db_repository is None:
raise RepositoryNotFound
+ if db_collection_subscriptions.count_documents(
+ {"repository_id": data["repository_id"]}
+ ) >= current_app.config["FOCA"].endpoints["subscriptions"].get(
+ "max_per_repository", DEFAULT_MAX_SUBSCRIPTIONS
+ ):
+ raise TooManySubscriptions
for i in range(retries):
</code_context>
<issue_to_address>
**Subscription limit is exceeded**
When multiple registrations for the same repository arrive while its count is near the configured limit, `register_subscription` calls can all pass `count_documents` before any inserts complete, so the repository exceeds `max_per_repository` and notification fan-out can exceed the configured thread bound.
Make the per-repository limit check and subscription insertion atomic or otherwise serialize registrations for the same repository.
</issue_to_address>
### Comment 6
<location path="pubgrade/modules/endpoints/builds.py" line_range="40" />
<code_context>
+# An image with a tag (no digest), optionally with a registry and its port
+IMAGE_WITH_TAG = re.compile(
+ r"[a-zA-Z0-9][a-zA-Z0-9._:/-]*:[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}"
+)
+
</code_context>
<issue_to_address>
**Invalid image reference reaches subscribers**
When a caller supplies an image reference with multiple tag separators, `IMAGE_WITH_TAG.fullmatch` accepts the extra colon, and `notify_subscriptions` splits at the last colon and sends an invalid image reference to subscribers instead of returning `InvalidImage`.
Constrain the image-name pattern so it allows a registry port but rejects additional tag separators.
</issue_to_address>
### Comment 7
<location path="pubgrade/modules/endpoints/builds.py" line_range="154" />
<code_context>
if data_from_db["access_token"] != access_token:
raise Unauthorized
+ if not all(
+ IMAGE_WITH_TAG.fullmatch(image["name"]) for image in build_data["images"]
+ ):
+ raise InvalidImage
</code_context>
<issue_to_address>
**Empty image list becomes stuck**
When builds are enabled and a request contains an empty `images` list, `all()` returns true for the empty list, so validation passes and `register_builds` indexes `images[0]`, returning an internal error and leaving the build queued.
Reject an empty `images` list during request validation.
</issue_to_address>
### Comment 8
<location path="pubgrade/api/pubgrade.yaml" line_range="242-244" />
<code_context>
description: Register a new build for already registered repository.
Ideally this endpoint is directly called by continuous integration (CI)
- pipelines. This endpoint is also responsible to trigger build at pubgrade.
+ pipelines. With builds switched off (the default), the request names one
+ prebuilt image with a tag and no `location` or `dockerhub_token`, and
+ Pubgrade notifies the repository's subscriptions of it; the build's
+ `notifications` hold the results. With builds switched on, this endpoint
+ triggers a build at Pubgrade.
</code_context>
<issue_to_address>
**Prebuilt schema misleads clients**
When a client relies on the published OpenAPI schema to construct a request while builds are disabled, openAPI clients still see `BuildRegister.images` described as supporting multiple images and `Image.location` as having a Dockerfile default, although prebuilt-image requests are rejected unless they contain exactly one image and no `location`. Callers following the published schema can send requests that the default deployment rejects.
Update the schema descriptions to document the prebuilt request constraints and distinguish them from build-enabled requests.
</issue_to_address>
### Comment 9
<location path="pubgrade/modules/endpoints/subscriptions.py" line_range="104-107" />
<code_context>
if data_from_db_repository is None:
raise RepositoryNotFound
+ if db_collection_subscriptions.count_documents(
+ {"repository_id": data["repository_id"]}
+ ) >= current_app.config["FOCA"].endpoints["subscriptions"].get(
+ "max_per_repository", DEFAULT_MAX_SUBSCRIPTIONS
+ ):
+ raise TooManySubscriptions
for i in range(retries):
</code_context>
<issue_to_address>
**Subscription counts scan the collection**
When the subscriptions collection grows beyond a small deployment, `count_documents()` filters on `repository_id`, but the subscriptions collection has no index on that field. Each registration scans an increasingly large collection, making subscription registration slower as the service accumulates repositories.
Add an index on `repository_id` for the subscriptions collection.
</issue_to_address>Linked issues
#35 feat: make the chart deployable on OpenShift · 9 of 11 met · 2 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Load configuration from an operator-created Secret; use safe image defaults and update the docs. | ✅ Met | The chart mounts the configured Secret, the image defaults have no admin users or debug mode, and the README explains creating and using the Secret. |
| 2 | With builds off, create no updater, shared volume, Role, or build Secret. | ✅ Met | The build resources and build Secret references are conditional on builds.enabled; chart tests check the default rendering. |
| 3 | Use org-owned images and a supported MongoDB version by default. | ✅ Met | The chart defaults to elixircloud/pubgrade images and mongo:7.0. |
| 4 | Choose between Ingress and Route by value or cluster type, with TLS on both. | ✅ Met | The chart creates a Route when the OpenShift API is present unless Ingress is enabled; the rendered variants are checked in tests/chart.sh. |
| 5 | Use ClusterIP services, each selecting only its own pods. | ✅ Met | Both Services use ClusterIP and component-specific selectors. |
| 6 | Run without a fixed user ID, including under an arbitrary user ID in group 0. | ✅ Met | The chart sets no fixed runAsUser; the Dockerfile grants group-0 write access where needed, and the CI smoke test runs the image as 12345:0. |
| 7 | Use camelCase values. | ✅ Met | The chart values use camelCase names such as hostName, configSecret, and imagePullPolicy. |
| 8 | Test chart variants in CI with helm template. |
✅ Met | The Chart job runs tests/chart.sh, which renders and checks the default, OpenShift, Ingress, Secret, and builds variants. |
| 9 | Install on a local cluster with default values plus a config Secret, and confirm the API responds. | 👀 Check by hand (runtime) | A person should confirm this installation and API response on a local cluster; the PR reports a successful k3s test. |
| 10 | Deploy on OpenShift without special rights. | 👀 Check by hand (runtime) | A person should install and exercise the chart on a real OpenShift cluster; the PR says this was not verified there. |
| 11 | Remove personal registry references from the chart, Makefile, and docs. | ✅ Met | The chart, Makefile, and README use org-owned image references; no personal registry references remain in those locations. |
Sourcery assessment
Needs a human reviewer. 8 findings to address first, and moving an existing release to this chart requires removing it and installing with a new MongoDB volume and major version; repository, subscription, and build records may be lost, and reverting the chart will not restore them. On startup, the app also replaces the stored admin-user list with the configured list, so records removed by a mistaken configuration need to be recreated.
Blocking findings: pubgrade/app.py:42, helm/templates/mongodb/deployment.yaml:25, helm/templates/mongodb/deployment.yaml:32, helm/templates/pubgrade/deployment.yaml:31, pubgrade/modules/endpoints/subscriptions.py:107, and 3 more
Threads per notification stay within the limit of subscriptions, also for lists longer than that. Completing a build needs the token of the repository that the build belongs to. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Image references follow Docker's rules, and requests without images or image names get a 400 instead of a server error. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # tests/pubgrade/endpoints/test_builds.py
MongoDB listens on the configured port, and the builds' Role has no rights on Services, which nothing uses. The README names the storage class that builds need, and says to use HTTPS for callbacks outside the cluster. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Push both images by digest in the environment dev-images, scan exactly those digests, then attest, sign with Sigstore and tag them, as cloud-registry does. Report unit test coverage to Codecov. Drop the date tag, which the other repos don't publish. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Always write the coverage report and hand it to the host user, also when tests fail. Document the environment, secrets and variable that publishing needs, and how to verify an image's signature. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…images # Conflicts: # tests/smoke.sh
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #43 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 669 669
=========================================
Hits 669 669 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # README.md # pubgrade/config.yaml # tests/pubgrade/endpoints/test_builds.py
Closes #35
Stacked on #37 and the branches of #34 and #33. Until those are merged, this diff against
devalso shows their commits; review only the commits of this branch. The base isdevso that CI runs.Summary
helm/(now 0.2.0) installs Pubgrade and a MongoDB on Kubernetes or OpenShift, into any namespace and without special rights: arbitrary user IDs, a Route where the API exists and no Ingress is set, a NetworkPolicy for MongoDB, values in camelCase.builds.enabled.pubgrade.configSecret). The configuration in the image has no admin users and no debug mode; at each start, the admin users in the database are made to match the configuration.Chartrenders the variants (tests/chart.sh); the smoke test runs under an arbitrary user ID.Verification
make test: 158 tests pass, 100% coverage.helm lint helm --strictandtests/chart.shpass.CI passed.Declined review findings
httpsfor callbacks, and restricting their targets: sidecars in the same cluster are the main use. The README says to usehttpsoutside the cluster.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Make Pubgrade deployable on Kubernetes and OpenShift with secure defaults, configurable administration, and optional build support.
New Features:
Bug Fixes:
Enhancements:
CI:
Tests: