Skip to content

docs: fix upgrade docs for 1.0.0rc2 - #342

Merged
uniqueg merged 2 commits into
devfrom
docs/338-upgrade-docs
Nov 3, 2026
Merged

uniqueg merged 2 commits into
devfrom
docs/338-upgrade-docs

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Closes #338

Summary

Documentation lows of the 1.0.0rc2 pre-release review, before the tag, as packaged chart READMEs and the docs of a tag can't be changed afterwards:

  • Chart README, going back (L1): helm rollback, --atomic and GitOps reverts don't get 1.0.0rc1 running by themselves once a pod of this version has started; a new bullet has the steps, the command and the link to the upgrade guide.
  • Misrouted roles (L2): the rule can also be a grant of maintainer or a downgrade, so apply its role to <user-id> first, then revoke users/<user-id>; also check other role changes of the rollout.
  • Privacy (L4): invitations that weren't accepted also keep who created them and when, for up to 37 days by default, and the listing of a removed owner's invitations.
  • Steps add up (L5): one paragraph in the intro of the upgrade guide.
  • UI version (L6): names 1.0.0-rc2 of cloud-registry-ui, which is to be tagged in lockstep with this release.
  • Identifiers (L7): the segments . and .. are refused anywhere, not only at the start.

Light lane: only docs change, no behaviour; I reviewed the diff myself.

Verification

  • mkdocs build --strict: passes.
  • pytest tests/test_version_mentions.py tests/test_chart_readme.py tests/test_docs_hooks.py: 125 passed.
  • The Helm commands were not run in a cluster; the failure and the drop of the index come from the review's runs on MongoDB 7.0.34.

🤖 Generated with Claude Code

https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG

Summary by Sourcery

Clarify 1.0.0rc2 upgrade, rollback, role migration, UI compatibility, and invitation privacy documentation.

Enhancements:

  • Clarify upgrade and rollback procedures, including role migration safeguards and the required MongoDB cleanup when reverting from 1.0.0rc2.
  • Document invitation retention, creator visibility, identifier restrictions, and the cumulative handling of skipped upgrade versions.
  • Update upgrade guidance to identify the cloud-registry-ui 1.0.0-rc2 compatibility requirement.

Documentation:

  • Correct and expand the 1.0.0rc2 deployment, access-control, and upgrade documentation.

Chart README: how to go back (the index blocks 1.0.0rc1), which packaged
READMEs can't add later. Recovery of misrouted roles also for downgrades
and grants of maintainer. Kept invitations also keep their creators. The
steps of the upgrade guide add up; name the matching version of the UI.
Identifiers: the segments . and .. are refused anywhere.

Closes #338

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
@uniqueg uniqueg added this to the v1.0.0-rc2 milestone Nov 3, 2026
@uniqueg uniqueg added the type: docs Improvements or additions to documentation label Nov 3, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Updates the deployment and upgrade documentation for 1.0.0rc2 by documenting rollback/index recovery, cumulative upgrade handling, corrected permission migration, invitation metadata retention, identifier restrictions, and the required cloud-registry-ui rc2 version.

Sequence diagram for 1.0.0rc2 rollback recovery

sequenceDiagram
    participant Operator
    participant Helm
    participant App
    participant MongoDB

    Operator->>Helm: helm rollback
    Helm->>App: Start 1.0.0rc1 pod
    App->>MongoDB: Check indexes
    MongoDB-->>App: expires_at_1 conflicts
    App-->>Helm: Startup failure
    Operator->>App: Scale app to 0 replicas
    Operator->>MongoDB: dropIndex(expires_at_1)
    Operator->>Helm: Move clients back and deploy 1.0.0rc1
    Helm->>App: Start 1.0.0rc1 pod
    App->>MongoDB: Start successfully
Loading

Sequence diagram for corrected permission migration

sequenceDiagram
    participant Admin
    participant PermissionsAPI

    Admin->>PermissionsAPI: GET /services/<id>/permissions
    PermissionsAPI-->>Admin: Identify roles on users/<user-id>
    Admin->>PermissionsAPI: PUT /services/<id>/permissions/users/<user-id>
    PermissionsAPI-->>Admin: Grant role to <user-id>
    Admin->>PermissionsAPI: DELETE /services/<id>/permissions/users/users/<user-id>
    PermissionsAPI-->>Admin: Revoke legacy role
Loading

State diagram for invitation retention after role revocation

stateDiagram-v2
    [*] --> Open
    Open --> Accepted: Accept invitation
    Open --> Expired: expiry reached
    Open --> Expired: creator role revoked
    Expired --> Removed: retention period ends
    Open --> Removed: keep_expired_days = 0
    Accepted --> Removed: expiry and cleanup
    Open --> Open: Remains listed with creator metadata
Loading

Flow diagram for cumulative version upgrades

flowchart TD
    Start[Skipping versions] --> Oldest[Apply oldest version section first]
    Oldest --> Next[Apply each intervening version section]
    Next --> Strictest[Follow the strictest rollout guidance]
    Strictest --> Target[Complete upgrade to 1.0.0rc2]
Loading

File-Level Changes

Change Details Files
Document rollback recovery requirements after upgrading to 1.0.0rc2.
  • Explain why Helm, atomic, and GitOps reverts cannot recover automatically after the new index is created.
  • Provide commands and configuration steps to scale down, remove the incompatible setting, and drop the MongoDB index.
  • Link deployment guidance to the detailed upgrade procedure.
deployment/README.md
docs/upgrading.md
Correct the permission-role migration procedure for conflicting user identifiers and broader role changes.
  • Require granting the intended role to the user identifier before revoking the legacy users/ rule, including maintainer grants or downgrades.
  • Prompt reviewers to check other rollout role changes that may have been mishandled.
deployment/README.md
docs/upgrading.md
Clarify invitation privacy, retention, and visibility behavior.
  • Document retention of labels and creator metadata for unaccepted invitations, including after creator role removal.
  • Explain default retention duration and listing behavior for current owners.
docs/access-control.md
docs/upgrading.md
Expand upgrade compatibility documentation for cumulative upgrades and rc2 clients.
  • State that skipped-version upgrade sections must all be applied, using the strictest rollout guidance.
  • Identify cloud-registry-ui 1.0.0-rc2 as the version using the new permission paths and invitation status.
docs/upgrading.md
Align documented identifier restrictions with the implemented behavior.
  • Clarify that path segments . and .. are rejected anywhere in identifiers, not only at the beginning.
docs/access-control.md

Possibly linked issues


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 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (19a6c82) to head (ff0ff8d).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #342   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         2406      2406           
=========================================
  Hits          2406      2406           

☔ 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 3, 2026 10:32

@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 found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/access-control.md" line_range="404-406" />
<code_context>
+  within about a minute. Owners can remove expired ones earlier. Until then,
+  invitations that weren't accepted keep their label, and who created them and
+  when (`created_by`, `created_as`, `created_at`), and current owners see the
+  creators. Revoking a role only cleans the invitations that the user accepted,
+  not those they created: these stay listed, also as `open` until they expire,
+  although accepting them then returns `404` (see **Creators**).
 - **Limit:** a service has at most
   `custom.access_control.invitations.max_per_service` invitations that
</code_context>
<issue_to_address>
**Admin-created invitations remain usable**

When an invitation was created as admin and that creator’s service role is revoked, `_creator_may_grant` accepts invitations recorded as admin regardless of the creator’s service role, so their links can still grant roles despite the docs saying acceptance returns `404`; operators may leave live links unrevoked.

Limit the `404` claim to invitations whose recorded creator authority was lost, and clarify that other open invitations can remain usable and should be explicitly revoked if no longer wanted.
</issue_to_address>

### Comment 2
<location path="deployment/README.md" line_range="902-905" />
<code_context>
+  rollback`, `helm upgrade --atomic` and automatic reverts of GitOps tools don't
+  get the app running again by themselves, and neither does a pod of 1.0.0rc1
+  that restarts during a rolling update. Data is kept. To go back, scale the app
+  to 0 replicas and move clients back, remove
+  `config.custom.access_control.invitations.keep_expired_days` from your values
+  if you set it, which 1.0.0rc1 refuses, and drop the index first (if the app
+  only ran with `keep_expired_days: 0`, it doesn't conflict). Without
+  authentication, omit `-u`, `-p` and `--authenticationDatabase`:
+
</code_context>
<issue_to_address>
**Rollback index gets recreated**

When the scale-to-zero has been accepted but a 1.0.0rc2 pod is still starting when the index is dropped, `mongosh ... dropIndex("expires_at_1")` removes the index, then the still-starting 1.0.0rc2 pod's startup `apply_keep_expired_days()` recreates it; 1.0.0rc1 still fails with the index conflict, so the rollback does not recover.

Wait until all 1.0.0rc2 pods have terminated before dropping the index, and ensure no controller scales them back up before the old version starts.
</issue_to_address>

### Comment 3
<location path="docs/upgrading.md" line_range="81-82" />
<code_context>
-    on 1.0.0rc1 `DELETE /services/<id>/permissions/users/<user-id>`).
+    revoked (`409 Conflict`). Such a role can also be a grant of `maintainer`
+    or a downgrade, after which `<user-id>` still has their former role. So for
+    each rule, admins first grant its role (`v1`) to `<user-id>`, and then revoke
+    `users/<user-id>` (`DELETE /services/<id>/permissions/users/users/<user-id>`,
+    on 1.0.0rc1 `DELETE /services/<id>/permissions/users/<user-id>`). Also check
+    the other role changes of the rollout: a revocation that reached such a pod
</code_context>
<issue_to_address>
**Only-owner downgrade cannot be repaired**

When the misrouted maintainer role is a downgrade of the service’s only owner, the prescribed grant of `maintainer` to `<user-id>` returns `409` because `put_role` rejects downgrading the only owner, so admins cannot complete the recovery sequence and the intended downgrade is lost.

Document a recovery sequence that handles the only-owner case without attempting the rejected grant.
</issue_to_address>

Linked issues

#338 docs: fix upgrade docs for 1.0.0rc2 · 6 of 6 met

# Requirement Status Notes
1 Document the 1.0.0rc1 rollback failure and give the steps to drop the index, remove keep_expired_days, and link the upgrade guide. ✅ Met The chart README explains when 1.0.0rc1 pods fail to start, covers rollback and restart scenarios, gives the recovery steps and command, and links the upgrade guide.
2 Recover misrouted roles by granting the role to before revoking users/, and check other role changes made during the rollout. ✅ Met The upgrade steps cover grants of maintainer and downgrades, give the grant-then-revoke order, and warn that rollout revocations may not have revoked the intended user's role.
3 Document retained invitation creators and timestamps, retention duration, creator visibility, and removed-owner invitations remaining open until expiry despite acceptance returning 404. ✅ Met The upgrade guide names the retained fields and default maximum duration; the access-control Removal section explains visibility and the behavior of invitations created by users who lost their role.
4 Say that upgrade steps accumulate when skipping versions. ✅ Met The upgrading guide instructs readers to apply all intervening sections from oldest to newest and follow the strictest rollout guidance.
5 Name the cloud-registry-ui version that uses the new paths and invitation status. ✅ Met The guide identifies version 1.0.0-rc2.
6 Correct the identifier documentation to say that the segments . and .. are refused anywhere, not only at the start. ✅ Met The access-control documentation now says identifiers containing those segments are refused.

Sourcery assessment

Approval pending. 3 findings to address first.

Blocking findings: docs/access-control.md:406, deployment/README.md:905, docs/upgrading.md:82


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

Comment thread docs/access-control.md Resolved
Comment thread deployment/README.md Resolved
Comment thread docs/upgrading.md Resolved
Pods must have terminated before the index is dropped, as one still
starting creates it again. A recovery step can return 409 if the service
would have no owner left. Invitations created as an admin, or through a
group that is still owner, stay valid after the creator's role is revoked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG

@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.

Sourcery assessment

Approved.

@uniqueg
uniqueg merged commit c9d09b5 into dev Nov 3, 2026
32 checks passed
@uniqueg
uniqueg deleted the docs/338-upgrade-docs branch November 3, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: fix upgrade docs for 1.0.0rc2

1 participant