Skip to content

feat!: remove the /v2/api-docs alias - #206

Merged
uniqueg merged 2 commits into
devfrom
build/188-remove-v2-api-docs
Nov 17, 2026
Merged

uniqueg merged 2 commits into
devfrom
build/188-remove-v2-api-docs

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Closes #188

Summary

Removes the /v2/api-docs alias, which forwarded to /v3/api-docs in 2.0.0 and was deprecated there.

  • ApiDocsAliasController is removed; the path of the API description (API_DOCS) moves to ApiDocsConfiguration.
  • /v2/api-docs is no longer in ResourceServerConfiguration.ALLOWED_URLS: without the auth profile it gives 404; with it, 401 without a token, like any other path that isn't public.
  • ApiDocsAliasIT is replaced by SwaggerUiDisabledIT.formerApiDocs_isNotFound and SwaggerUiAuthIT.formerApiDocsWithoutToken_isUnauthorized.
  • The deprecation notes (Javadoc, application.properties, docs/api.md) are removed.
  • The smoke test's /v2/api-docs checks now expect the path to be gone: 404 by default, 401 with the auth profile and no token.
  • Breaking: docs/upgrading.md gets a "To 2.1.0" section saying that /v2/api-docs is gone. Its 2.0.0 item now points there. The 2.0.0 notes promised removal "in the next minor or major release".

Verification

  • ./mvnw -B spotless:check checkstyle:check (Temurin 21.0.13): BUILD SUCCESS.
  • The two new ITs failed before the removal (expected:<404> but was:<200>, expected:<401> but was:<200>).
  • ./mvnw -B clean verify (Temurin 21.0.13): 18608 unit and 143 integration tests passed, all coverage checks met.
  • mkdocs build --strict with docs/requirements.txt: OK.
  • CI: all checks passed (CI passed, Test, Lint, Docs, Smoke test with the new /v2/api-docs 404/401 checks, Scan image, CodeQL, codecov).
  • actionlint was not run locally (it isn't installed here; the Lint job runs it). The workflow change only deletes lines.

Notes

Review (adversarial-reviewer, quality-reviewer): no high findings.

  • Fixed (adversarial, low): the smoke test now checks that the image no longer serves /v2/api-docs.
  • Fixed (quality, medium): the change type. The PR title (the squash commit) is feat!:, following #773 (feat(auth)!:), so that the removal is grouped as breaking. The branch's commits keep build!: and ci:.

No second round: the medium finding was about the commit type only, and the fix touches only three lines of smoke checks, not the app's logic.

Declined review findings

  • The upgrade notes name 2.1.0, while the version isn't fixed yet (adversarial and quality, low): declined. The 2.0.0 notes promised removal in "the next minor or major release", and feat: ask an external AuthZEN decision service #200 names its notes "To 2.1.0" too. If release prep picks 3.0.0, it renames the heading and the #to-210 anchors.
  • docs/upgrading.md lines 348 and 449 still name /v2/api-docs (quality, low): declined. These lines belong to older upgrade sections (1.x), where that path was right. The "To 2.0.0" and "To 2.1.0" sections say where the description lives now.

🤖 Generated with Claude Code

Summary by Sourcery

Remove the deprecated /v2/api-docs alias and direct clients to the supported OpenAPI endpoints.

Enhancements:

  • Remove the deprecated /v2/api-docs alias so the API description is served only from the /v3/api-docs endpoints.
  • Update security behavior, integration coverage, smoke checks, and configuration references for the removed alias.

CI:

  • Update smoke tests to verify that /v2/api-docs returns 404 without authentication and 401 with the auth profile.

Documentation:

  • Document the breaking removal of /v2/api-docs and direct clients to the /v3/api-docs JSON or YAML endpoints.

Tests:

  • Replace alias coverage with tests asserting 404 when Swagger UI is unauthenticated and 401 when authentication is enabled without a token.

uniqueg and others added 2 commits November 17, 2026 18:42
/v2/api-docs forwarded to /v3/api-docs for one release (2.0.0) and was
deprecated. Remove ApiDocsAliasController and its entry in the public
paths of ResourceServerConfiguration; the path of the API description
moves to ApiDocsConfiguration. Drop the smoke checks of the alias and
the deprecation notes, and say in the upgrade notes for 2.1.0 that the
path is gone. ApiDocsAliasIT gives way to tests that /v2/api-docs
gives 404 without the auth profile, and 401 without a token with it.

BREAKING CHANGE: /v2/api-docs is no longer served; read the API
description at /v3/api-docs (or /v3/api-docs.yaml).

Closes #188

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The smoke test checks that the former path of the API description gives
404 without the auth profile and 401 without a token with it, so that
the built image, not only the integration tests, shows the removal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Reviewer's Guide

API

Remove the /v2/api-docs controller and define the surviving /v3/api-docs path in the API-docs configuration.

  • src/main/java/uk/ac/ebi/tsc/tesk/config/swagger/ApiDocsConfiguration.java L14-16
  • src/main/java/uk/ac/ebi/tsc/tesk/config/swagger/ApiDocsAliasController.java (deleted)

Configuration

Stop treating the former API-docs path as public under authentication, and update application and image checks to reflect its removal.

  • .github/workflows/ci.yml L224-225, L230, L236
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/ResourceServerConfiguration.java L24, L40-46
  • src/main/resources/application.properties L62-63

Documentation

Document that /v2/api-docs is gone in 2.1.0 and direct users to the OpenAPI 3.1 endpoints.

  • docs/api.md L17-19
  • docs/upgrading.md L3-13, L42-43

Tests

Replace alias-specific coverage with checks for the former path's unauthenticated 404 and authenticated 401 behavior, updating the shared test URL constant.

  • src/integration-test/java/uk/ac/ebi/tsc/tesk/SwaggerUiAuthIT.java L6, L65-73
  • src/integration-test/java/uk/ac/ebi/tsc/tesk/SwaggerUiDisabledIT.java L6, L45-50
  • src/test/java/uk/ac/ebi/tsc/tesk/UrlConstants.java L3, L16-22
  • src/integration-test/java/uk/ac/ebi/tsc/tesk/ApiDocsAliasIT.java (deleted)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ae3bc2a) to head (36776d1).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #206   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           54        53    -1     
  Lines         2342      2340    -2     
  Branches       274       274           
=========================================
- Hits          2342      2340    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 17, 2026 19:15
@sourcery-ai

sourcery-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit 36776d1

#188 build: remove the /v2/api-docs alias · 3 of 3 met

# Requirement Status Notes
1 Remove ApiDocsAliasController, its ResourceServerConfiguration.ALLOWED_URLS entry, and ApiDocsAliasIT. ✅ Met The controller and integration test are deleted, and the allowed paths now include only the /v3/api-docs routes.
2 Remove the smoke checks for the alias and its deprecation notes. ✅ Met The smoke checks expecting the alias to work are replaced with checks for its removal; the deprecation notices are replaced with historical removal and upgrade information.
3 In the next minor or major release's upgrade notes, say that /v2/api-docs is gone. ✅ Met The new “To 2.1.0” section says the path is gone and directs clients to /v3/api-docs.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@uniqueg
uniqueg merged commit 3574e56 into dev Nov 17, 2026
43 checks passed
@uniqueg
uniqueg deleted the build/188-remove-v2-api-docs branch November 17, 2026 20:04
uniqueg added a commit that referenced this pull request Nov 18, 2026
Bring in #201 (google-java-format update), #202 and #206 (removal of
the /v2/api-docs alias).

Conflicts:
- docs/upgrading.md: both PRs add items to "To 2.1.0"; the removal of
  /v2/api-docs goes first in the list of changes for all deployments.
- KubernetesClientWrapper: #201 only reformatted the creator filter
  that this branch moved into listAllTaskmasterJobsForUser; kept the
  moved version.

Files of this branch reformatted with spotless:apply for #201.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

build: remove the /v2/api-docs alias

1 participant