Skip to content

docs: Document repository API token creation and scope OD-395 - #2725

Merged
LipeGheno merged 8 commits into
masterfrom
doc/repo-tokens-product-page-OD-395
Aug 19, 2026
Merged

docs: Document repository API token creation and scope OD-395#2725
LipeGheno merged 8 commits into
masterfrom
doc/repo-tokens-product-page-OD-395

Conversation

@pedrobpereira

@pedrobpereira pedrobpereira commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Changes

  • docs/codacy-api/api-tokens.md: document repository API token name rules, mandatory 1-year-max expiry (no never-expire option), that the token value stays fully visible after creation (not masked), grandfathered legacy tokens without an expiry, the distinct "token expired" error, and the full list of 13 operations a repository token can authorize (own repository only).
  • docs/codacy-api/using-the-codacy-api.md: correct the auth section's outdated claim that all API v3 endpoints require an account token, and add a note on repository-token expiry/error behavior.

👀 Live preview

https://doc-repo-tokens-product-page-od-395--docs-codacy.netlify.app

🚧 To do

  • If relevant, include the Jira issue key at the end of the pull request title
  • Perform a self-review of the changes
  • Fix any issues reported by the CI/CD

Manual Testing

Add manual testing evidence here (steps, screenshots, environment).

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Overall readability score: 53.81 (🟢 +0.02)

File Readability
index.md 60.26 (🟢 +1.36)
using-the-codacy-api.md 55.95 (🟢 +0.22)
api-tokens.md 70.97 (🟢 +2.84)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
index.md 60.26 40.04 9.85 11 11.94 7.26
  🟢 +1.36 🔴 -0.2 🟢 +0.18 🟢 +0.1 🟢 +0.23 🟢 +0.19
using-the-codacy-api.md 55.95 42.41 11.13 13.1 11.78 7.16
  🟢 +0.22 🔴 -0.2 🔴 -0.01 🔴 -0.1 🟢 +0.11 🟢 +0.08
api-tokens.md 70.97 40.45 8.17 9.2 10.43 6.32
  🟢 +2.84 🟢 +0.21 🟢 +0.5 🟢 +0.3 🟢 +0.23 🟢 +0.37

Averages:

  Readability FRE GF ARI CLI DCRS
Average 53.81 42.85 10.97 12.39 12.3 8.03
  🟢 +0.02 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

@github-actions
github-actions Bot temporarily deployed to Netlify August 6, 2026 13:22 Inactive
@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@pedrobpereira
pedrobpereira force-pushed the doc/repo-tokens-product-page-OD-395 branch from fd791d7 to 5234b79 Compare August 6, 2026 13:28
@github-actions
github-actions Bot temporarily deployed to Netlify August 6, 2026 13:30 Inactive
@pedrobpereira
pedrobpereira force-pushed the doc/repo-tokens-product-page-OD-395 branch from 5234b79 to 8b7d7ba Compare August 6, 2026 13:32
@github-actions
github-actions Bot temporarily deployed to Netlify August 6, 2026 13:34 Inactive
Cover name rules, mandatory 1-year expiry, the 13 allowed operations, and expired-token handling for repository tokens.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pedrobpereira
pedrobpereira force-pushed the doc/repo-tokens-product-page-OD-395 branch from 8b7d7ba to fdebbb4 Compare August 6, 2026 13:35
@github-actions
github-actions Bot temporarily deployed to Netlify August 6, 2026 13:36 Inactive
@LipeGheno
LipeGheno marked this pull request as ready for review August 11, 2026 12:43
@LipeGheno
LipeGheno requested a review from a team as a code owner August 11, 2026 12:43

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

The documentation updates generally align with the requirements for detailing Repository API token creation and scoping. However, the PR fails to document that token values remain fully visible (not masked) after creation, a detail explicitly mentioned in the PR intent. Additionally, the phrasing in some sections could lead to confusion between the restricted scope of API v3 tokens versus legacy API v2 behavior. Codacy results indicate the PR is up to standards with no new quality issues.

About this PR

  • The PR description indicates that documentation would include a note about the token value staying 'fully visible after creation (not masked)', but this information is absent from the repository API tokens section.

Test suggestions

  • Verify documentation of naming constraints for repository tokens.
  • Verify documentation of the 1-year maximum expiration and absence of 'never-expire' option.
  • Verify documentation of the 13 specific authorized operations for API v3.
  • Verify documentation that legacy tokens without expiry are grandfathered.
  • Verify mention of 'token value stays fully visible after creation (not masked)'
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify mention of 'token value stays fully visible after creation (not masked)'

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Comment thread docs/codacy-api/api-tokens.md Outdated
Comment thread docs/codacy-api/api-tokens.md
Comment thread docs/codacy-api/using-the-codacy-api.md Outdated
- Repository token names are unique per repository (confirmed by
  Andrzej Janczak), not just character-restricted.
- The Codacy Cloud CLI doesn't currently support repository tokens
  (confirmed by Andrzej Janczak) — the intro list implied it did for
  both token types.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to Netlify August 11, 2026 14:05 Inactive
…D-395

Add screenshots for the repository API token flow: the create modal, the
custom date option, the newly created token, the bulk delete, and a
repository with a token that never expires. Replace the account API token
screenshots, which no longer matched the UI.

Correct the parts of the page the new screenshots contradicted:

- Repository API tokens are under Settings > API tokens, not Integrations.
- Account API tokens can no longer be created without an expiration date,
  and are capped at one year like repository tokens.
- Tokens are revoked with the trash icon in the Actions column, or in bulk
  by selecting them and clicking Delete tokens.
- Document that the token value is shown only once, immediately after
  creation.

Add a recommendation to replace tokens without an expiration date, in both
sections, including the order to follow so that live integrations don't
break.

Remove two images that no longer have any reference and no longer match the
UI: codacy-api-tokens-account.png and codacy-api-tokens-repository.png.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to Netlify August 14, 2026 08:38 Inactive
Comment thread docs/codacy-api/api-tokens.md Outdated
Comment thread docs/codacy-api/api-tokens.md Outdated
Comment thread docs/codacy-api/api-tokens.md Outdated
LipeGheno and others added 2 commits August 14, 2026 10:29
- The Codacy Cloud CLI does support repository API tokens since OD-489
  shipped, so drop the claim that it doesn't.
- Reword the notes on tokens created before expiration dates became
  mandatory, following Claudia's suggestion.
- Turn the account-level note into a paragraph and the repository one back
  into a note, so the page keeps the same number of admonitions it had
  before the screenshots were added.
- Stop blurring the token name in the never-expires screenshot: it's a
  generated name rather than a token value, and it was inconsistent with
  the bulk delete screenshot, which shows names unblurred.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to Netlify August 14, 2026 09:32 Inactive
@LipeGheno

Copy link
Copy Markdown
Contributor

One open question, since it predates this PR and I couldn't settle it from screenshots: the account section still says "By hovering a token, you are able to copy its value." The account tokens table now masks the value (xxxxxxxxxxxxxxxxxLli), so it isn't clear whether hover-to-copy still exists. I left the line untouched — @claudiacodacy @andrzej-janczak, can one of you confirm in the UI?

Removing the claim that the CLI doesn't support repository API tokens left
the documentation silent about it. Document it instead, now that OD-489
shipped in codacy-cloud-cli v1.9.0:

- The option --repository-token and the CODACY_PROJECT_TOKEN environment
  variable, and that codacy login only takes account API tokens.
- The precedence between the two tokens, the option, and stored credentials.
- That commands outside the operations a repository API token authorizes
  fail immediately, and that codacy repository omits pull request and
  coverage data.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to Netlify August 14, 2026 10:09 Inactive
Per .claude/reference/formatting.md, checked against the docs-review-page
rubric:

- api-tokens.md: the two "replace grandfathered tokens" notes packed a
  3-step sequence the reader must follow in order into one comma-chained
  sentence. Converted to a nested numbered list in both places, without
  adding an admonition, so the admonition count from the last round stays
  the same.
- codacy-cloud-cli/index.md: split ## Authentication into ### Account API
  tokens and ### Repository API tokens, matching the ### subsection pattern
  already used by every other multi-topic section on this page (## What you
  can do, ## Example workflows). Moved "To remove your stored credentials"
  under Account API tokens, since codacy logout only applies to stored
  login credentials, not to a repository token passed via flag or env var.

Verified with mkdocs build --strict: no broken anchors, no duplicate
heading ids on the page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to Netlify August 14, 2026 10:23 Inactive
Codacy's AI reviewer flagged this on the original PR and it was never
addressed: "Repository API tokens always have an expiration date" was
already false the moment api-tokens.md documented that tokens created
before expiration dates became mandatory keep working without one.

Add "New" to scope the claim to newly created tokens, matching the
reviewer's own suggested wording. The linked section already explains the
grandfathered-token exception, so this stays a one-word fix rather than
duplicating that explanation on a second page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@LipeGheno
LipeGheno merged commit 0f1f2c6 into master Aug 19, 2026
5 checks passed
@LipeGheno
LipeGheno deleted the doc/repo-tokens-product-page-OD-395 branch August 19, 2026 14:10
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.

4 participants