Repository navigation
docs: add MkDocs docs and align the README - #77
Conversation
Add ci.yml as in the org's other repositories (PR title, lint, test, smoke test, image scan, gate). The scan only reports until the dependency update. The base image of the Dockerfile no longer exists; build from source on Temurin 8 instead (not Alpine: TLS handshakes fail there on Java 8). Add a .dockerignore. Remove the old workflows, which can't run any more and would publish over the tag of the last release on every push to master, and Travis. Closes #59 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move to the last releases of the Spring Boot 2.7 line, and pin the transitive dependencies the scan flags. spring-security-oauth2 2.5 makes its exception translator generic, which the entry point adapts to. What is fixed only in Spring Boot 3 goes to .trivyignore.yaml, each entry with its reason and expiry date. The scan in CI now fails on fixable critical and high findings. Closes #60 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add release.yml as in the org's other repositories: a tag vX.Y.Z publishes X.Y.Z (and latest for the highest release) to the same image name, by digest, after checks of the tag and of CI, and a scan. Other version tags stay untouched. After that, one POST to Pubgrade, skipped unless its settings are set. It needs Pubgrade's publish mode (elixir-cloud-aai/Pubgrade#33). Closes #61 Co-Authored-By: Claude Opus 5.5 <[email protected]>
GET /service-info stays public by default, also with the auth profile. TESK_API_SERVICE_INFO_PUBLIC=false requires a valid token for it. Test both settings with and without a token, and fix auth.md, which said that all endpoints are secured. Part of elixir-cloud-aai/TESK#216, whose chart change follows. Closes #62 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A re-run of all jobs builds a new digest: refuse it if X.Y.Z points to another one. Publish one release at a time, so that latest is decided and written in one go. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Align CI with the branching model of the org's other repositories (`dev` + `main`): run on pull requests and pushes to `dev`; on pushes, push the image by digest in the environment `dev-images`, scan exactly that digest, then attest, sign and tag it `dev` and `sha-<commit>`, as cloud-registry does. Add the weekly scan of `latest` (`scan.yml`), let Dependabot target `dev`, and fail pushes on Codecov upload errors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Publish only on pushes to this repository, or to forks that set `DOCKERHUB_ORG` (`PUBLISH`, as in proTES and foca): other runs scan a local build, upload nothing to code scanning and don't fail on Codecov upload errors, and the gate allows the skipped publishing jobs. Name the environment and secrets publishing needs in the README, and fix comments from the review. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # .github/workflows/ci.yml
# Conflicts: # .github/workflows/ci.yml # .trivyignore.yaml
The branching model is now `dev` + `main`: release commits must be on `main`, `latest` goes by the tags on `main`, and CI must have passed for the push of the release commit to `dev`. As in cloud-registry, the version in `CITATION.cff` must be the release version, as Zenodo archives the tagged metadata. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refuse a version that is already published before attesting and signing the new digest, and fail on registry errors instead of taking them for a missing tag. Name the tag rulesets that protect the release and Pubgrade secrets, and clarify the version rules for pre-releases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Restore the files of #67 to their state on `dev`, so that this pull request no longer depends on #67, which waits for a decision. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Restore the files of #67 to their state on `dev`, so that this pull request no longer depends on #67, which waits for a decision. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move the documentation of the README and `auth.md` into `docs/` (MkDocs Material, styled like foca and cloud-registry): API and service info, configuration, access control, deployment, upgrade notes for 1.2.0, development and releases. Pages link to each other only within `docs/`, so that the TESK documentation can include them as its section "TESK API". Build them strictly in CI (job `Docs`), without publishing from here, and let Dependabot update their dependencies. The README follows the other repositories: logo, badges, synopsis, quick start, development, citation and contributing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # README.md # docs/access-control.md
Reviewer's GuideThe PR introduces a self-contained, strictly validated MkDocs Material documentation section, moves and expands access-control guidance into the new structure, updates the README as the primary user and contributor entry point, and wires documentation builds and dependency updates into project automation. Flow diagram for documentation CI dependenciesflowchart TD
Commit["Pull request or push to dev"] --> Docs["Docs: install docs/requirements.txt"]
Docs --> Strict["mkdocs build --strict"]
Strict --> Gate["CI passed"]
Gate --> Publish["Publish image"]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #77 +/- ##
=======================================
Coverage 55.94% 55.94%
=======================================
Files 64 64
Lines 2152 2152
Branches 234 234
=======================================
Hits 1204 1204
Misses 807 807
Partials 141 141 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Hey - I've found 8 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="README.md" line_range="41" />
<code_context>
+[kind](https://kind.sigs.k8s.io/)):
+
+```bash
+docker run --rm --publish 8080:8080 \
+ --volume "${HOME}/.kube/config:/root/.kube/config:ro" \
+ elixircloud/tesk-api:latest
</code_context>
<issue_to_address>
**Remote callers get unauthenticated task access**
When a developer runs either Docker example on a host reachable by untrusted callers, docker publishes port 8080 on all host interfaces, and the image defaults to `noauth`, so remote callers can submit and inspect tasks using the mounted Kubernetes credentials.
Bind the published port to localhost or require authentication for the exposed API.
Also at `docs/deployment.md:55-56`.
</issue_to_address>
### Comment 2
<location path="docs/deployment.md" line_range="37-38" />
<code_context>
+client](https://github.com/kubernetes-client/java). Inside the cluster, it uses
+the service account of its pod (`spec.template.spec.serviceAccountName` of its
+deployment); outside, the `KUBECONFIG` file. Either way, it needs the rights to
+create, read, list and label jobs and pods and to read pod logs in its
+namespace (`TESK_API_K8S_NAMESPACE`); the built-in `edit` role is enough. The
+taskmaster's service account (`TESK_API_TASKMASTER_SERVICE_ACCOUNT_NAME`)
+needs to manage jobs, pods and persistent volume claims.
</code_context>
<issue_to_address>
**Task creation permissions are incomplete**
When an operator configures a custom role from the documented resource list instead of using the built-in `edit` role, a deployment that grants only the documented job and pod permissions denies TESK API’s `createNamespacedConfigMap` call for every task; requests fail instead of creating tasks. When a task specifies RAM, the API also lists namespace LimitRanges, another permission the instructions omit.
Document the required ConfigMap creation and LimitRange listing permissions, along with the necessary job and pod patch permissions for cancellation.
</issue_to_address>
### Comment 3
<location path="docs/deployment.md" line_range="17" />
<code_context>
+
+```bash
+cosign verify elixircloud/tesk-api:1.2.0 \
+ --certificate-identity-regexp '^https://github\.com/elixir-cloud-aai/tesk-api/\.github/workflows/' \
+ --certificate-oidc-issuer https://token.actions.githubusercontent.com
+```
</code_context>
<issue_to_address>
**Release check accepts dev signatures**
When a consumer uses the documented command to verify a release tag whose digest has a CI/dev signature, the identity regex accepts any workflow and ref in this repository, including the CI workflow that signs dev images, so verification of a release tag does not establish that its digest was signed by the release workflow; callers can accept a dev-signed digest as a release artifact.
Restrict the identity regex to the release workflow and version-tag refs for release images.
</issue_to_address>
### Comment 4
<location path="README.md" line_range="42" />
<code_context>
+
+```bash
+docker run --rm --publish 8080:8080 \
+ --volume "${HOME}/.kube/config:/root/.kube/config:ro" \
+ elixircloud/tesk-api:latest
+```
</code_context>
<issue_to_address>
**Tasks use the wrong cluster configuration**
When the host's `KUBECONFIG` points to a file other than `~/.kube/config`, the Docker command mounts only `~/.kube/config` and does not pass the host's `KUBECONFIG` value into the container, so `Config.defaultClient()` reads the wrong or missing configuration and task requests fail to reach the intended cluster.
Mount the kubeconfig selected by the host's `KUBECONFIG` and make that file available at the container's default config path.
Also at `docs/deployment.md:56`.
</issue_to_address>
### Comment 5
<location path="docs/api.md" line_range="21" />
<code_context>
+`/v2/api-docs`.
+
+With the `auth` profile, all endpoints but service info, the Swagger UI and the
+API description need a valid access token; see [Access
+control](access-control.md).
+
</code_context>
<issue_to_address>
**Service info access requirements are misstated**
When the `auth` profile is active and `TESK_API_SERVICE_INFO_PUBLIC` is `false`, the API page says service info is exempt from authentication, but `/service-info` then requires a valid token, so clients that omit one receive `401 Unauthorized`.
Update the API page to state that `/service-info` requires a valid token when `TESK_API_SERVICE_INFO_PUBLIC` is false.
Also at `docs/api.md:20`.
</issue_to_address>
### Comment 6
<location path="docs/api.md" line_range="11" />
<code_context>
+--- | --- | ---
+`GET` | `/service-info` | Information about the service
+`POST` | `/tasks` | Create a task
+`GET` | `/tasks` | List tasks (filter by name prefix, pages)
+`GET` | `/tasks/{id}` | Get a task
+`POST` | `/tasks/{id}:cancel` | Cancel a task
</code_context>
<issue_to_address>
**Name filtering returns extra tasks**
When a client supplies `namePrefix` to list tasks, `TesServiceImpl.listTasks` does not apply `namePrefix`, so clients that request a name-prefix filter still receive tasks with other names.
Document name-prefix filtering as unsupported until the implementation applies the filter.
</issue_to_address>
### Comment 7
<location path="docs/configuration.md" line_range="27-28" />
<code_context>
+`TESK_API_TASKMASTER_EXECUTOR_SECRET_NAME` | Name of a Kubernetes secret to mount into every executor as a volume (all its files). Default: none.
</code_context>
<issue_to_address>
**Executor secret settings are ignored**
When a deployment configures the executor secret using the documented environment-variable names, spring Boot maps underscores in environment-variable names to property separators, so these names do not bind to `tesk.api.taskmaster.executor-secret.name` or `tesk.api.taskmaster.executor-secret.mount-path`; the secret therefore is not mounted at the documented path.
Document the Spring Boot environment-variable names that bind to these properties, or change the property names to match the documented forms.
</issue_to_address>
### Comment 8
<location path="docs/development.md" line_range="46-48" />
<code_context>
+to `dev`: it checks the pull request title, lints the workflows, builds and
+tests TESK API (with coverage to [Codecov](https://codecov.io/gh/elixir-cloud-aai/tesk-api)),
+builds the docs strictly, starts the image in both profiles, and scans the
+image for known vulnerabilities. The scan fails on critical and high
+vulnerabilities that have a fix, except those accepted in `.trivyignore.yaml`,
+each with a reason and an expiry date. On pushes to `dev`, it publishes the
+scanned and signed image as `<org>/tesk-api:dev` (and `sha-<commit>`), where
+`<org>` is the variable `DOCKERHUB_ORG` (by default `elixircloud`); this needs
</code_context>
<issue_to_address>
**CI scan does not block vulnerable images**
When trivy finds a fixable critical or high vulnerability not covered by an ignore entry, the scan step uses `fail: "false"`, so CI continues even when Trivy finds fixable critical or high vulnerabilities that are not ignored; maintainers see a non-blocking report rather than the failure the docs promise.
Set the scan action to fail on those findings, or revise the documentation to describe the scan as non-blocking.
</issue_to_address>Linked issues
#74 docs: add MkDocs docs and align the README · 4 of 5 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Add self-contained MkDocs Material documentation covering the API, service info, configuration, deployment, building and testing, and 1.2.0 upgrade notes. | ✅ Met | The docs pages cover the requested topics and use relative links between documentation pages. |
| 2 | Build the docs strictly in CI, without Read the Docs configuration or documentation publishing in this repository. | ✅ Met | The Docs job runs mkdocs build --strict and is included in the CI gate; no Read the Docs configuration or docs publishing job is added. |
| 3 | Align the README with the other repositories' structure and shields for CI, Codecov, docs, license, and release. | ✅ Met | The README includes all requested badges and the requested overview, quick start, development, citation, and contributing sections. |
| 4 | Point the README docs badge and links to the TESK API section on the TESK documentation site. | 👀 Check by hand (external system) | Verify that the configured /en/latest/tesk-api/ URL resolves to the TESK API section on the live TESK documentation site. |
| 5 | Configure Dependabot updates for the documentation dependencies. | ✅ Met | Dependabot is configured for pip in /docs, monthly, targeting dev with grouped updates. |
Sourcery assessment
Approval pending. 8 findings to address first.
Blocking findings: README.md:41, docs/deployment.md:38, docs/deployment.md:17, README.md:42, docs/api.md:21, and 3 more
Sourcery withdrew this approval because the latest commits introduced blocking findings.
Bind the local examples to localhost and mount the kubeconfig in use, limit the cosign identity to the release workflow and version tags, list the Kubernetes rights TESK API needs, and say that the name prefix filter is ignored, when service info needs a token, and that the CI scan only reports until the dependencies are updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Closes #74. Part of #72.
docs/in MkDocs Material, styled like foca and cloud-registry (mkdocs.yml: same theme, palette, extensions and validation): home and design, API (endpoints, service info, status codes), configuration (all settings, service info), access control (moved fromauth.md), deployment (images, signatures, Kubernetes, running locally), upgrading (1.2.0) and development (build, tests, CI, releases, stub generation).docs/as its "TESK API" section at build time: pages link only to each other with relative links withindocs/, and to source files with full GitHub URLs; no assumptions about the site-wide navigation. No Read the Docs config and no publishing here.Docs(mkdocs build --strict), added to the gate and to the needs ofPublish image.docs/requirements.txt, updated by a new Dependabotpipentry (targetdev, monthly, grouped).site_urlpoint to the tesk-api section of the TESK documentation, https://tesk.readthedocs.io/en/latest/tesk-api/.Light lane: docs, a docs CI job without secrets or permissions, and Dependabot config; I reviewed the diff myself.
Verified
mkdocs build --strict(mkdocs 1.6.1, mkdocs-material 9.8.0, pymdown-extensions 12.3): no warnings.yq).🤖 Generated with Claude Code
Summary by Sourcery
Add a standalone MkDocs documentation section and align the project README with the current TESK API documentation and distribution.
New Features:
Enhancements:
Build:
CI:
Documentation:
Chores: