Conversation
Co-authored-by: Vincent <vinckr@posteo.net>
📝 WalkthroughWalkthroughThe PR adds a new documentation page detailing Kratos feature deprecations with implementation guidance across deployment types, and updates the ConsoleLink component to support URL hash fragments while adding the deprecation page to the documentation sidebar. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
please fix conflicts so we can merge this 🙏 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/kratos/deprecations/index.mdx (1)
39-58: Clarify what is actually “deprecated” vs. what is merely “improved”.This page is under “Feature deprecations”, but the first impacted-functionality bullet reads like a general performance improvement (“This improvement may impact…”). The adaptation text does indicate a behavioral dependency change (don’t use the “updated session returned by
/extend” anymore), but it would be clearer to explicitly label that dependency as the deprecated behavior.For example, consider rephrasing the first bullet to something like: “Relying on the updated session returned by
/admin/sessions/{id}/extendis deprecated; fetch the updated session via/admin/sessions/{id}after extending.”(Keep the existing “How to adapt…” section—you mostly just need to make the deprecated dependency explicit.)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/kratos/deprecations/index.mdx` around lines 39 - 58, The "Who is impacted" bullet should explicitly mark the deprecated behavior: state that relying on the updated session returned by `/admin/sessions/{id}/extend` (SDK operation `extendSession`) is deprecated; instruct readers to instead call `/admin/sessions/{id}` (SDK operation `getSession`) after extending to retrieve the updated session. Keep the existing "How to adapt…" text but replace or prepend the first bullet under the `faster_session_extend` heading with this explicit deprecation statement referencing `extendSession` and `getSession`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/kratos/deprecations/index.mdx`:
- Around line 23-25: Replace the unhyphenated compound adjective "project level"
with the hyphenated form "project-level" in the sentence that references the
ConsoleLink component (ConsoleLink route="project.settings.advanced") so the
phrase reads "...unless you have explicitly disabled the deprecated feature via
a project-level feature flag." This ensures consistent compound-adjective
formatting across the deprecations page.
In `@src/components/ConsoleLink/console-link.tsx`:
- Around line 65-67: The URL builder currently appends the fragment verbatim
causing double hashes and unencoded characters; update the fragment handling
where the URL is constructed (using resolvedRoute and the hash variable) to
first normalize by stripping any leading '#' from hash, then apply
encodeURIComponent to the normalized fragment, and finally append it only if
non-empty as `#${encodedFragment}` so spaces and special characters are encoded
and you never produce `##...`.
---
Nitpick comments:
In `@docs/kratos/deprecations/index.mdx`:
- Around line 39-58: The "Who is impacted" bullet should explicitly mark the
deprecated behavior: state that relying on the updated session returned by
`/admin/sessions/{id}/extend` (SDK operation `extendSession`) is deprecated;
instruct readers to instead call `/admin/sessions/{id}` (SDK operation
`getSession`) after extending to retrieve the updated session. Keep the existing
"How to adapt…" text but replace or prepend the first bullet under the
`faster_session_extend` heading with this explicit deprecation statement
referencing `extendSession` and `getSession`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 34ff7e34-aa54-45d9-bf9c-5814b8710c7a
📒 Files selected for processing (3)
docs/kratos/deprecations/index.mdxsrc/components/ConsoleLink/console-link.tsxsrc/sidebar.ts
| If you're using an Ory Network project, your configuration will not change, unless you have explicitly disabled the deprecated | ||
| feature via a project level feature flag. To check which flags are currently enabled, go to | ||
| <ConsoleLink route="project.settings.advanced" />. |
There was a problem hiding this comment.
Fix minor grammar: “project level” → “project-level”.
Hyphenate “project-level” for consistent compound-adjective formatting.
🛠️ Proposed fix
-If you're using an Ory Network project, your configuration will not change, unless you have explicitly disabled the deprecated
-feature via a project level feature flag. To check which flags are currently enabled, go to
+If you're using an Ory Network project, your configuration will not change, unless you have explicitly disabled the deprecated
+feature via a project-level feature flag. To check which flags are currently enabled, go to
<ConsoleLink route="project.settings.advanced" />.[r a i s e _ m i n o r _ i s s u e]
[guidelines_check]
As per static analysis hint: “Use a hyphen to join words.” (QB_NEW_EN_HYPHEN)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| If you're using an Ory Network project, your configuration will not change, unless you have explicitly disabled the deprecated | |
| feature via a project level feature flag. To check which flags are currently enabled, go to | |
| <ConsoleLink route="project.settings.advanced" />. | |
| If you're using an Ory Network project, your configuration will not change, unless you have explicitly disabled the deprecated | |
| feature via a project-level feature flag. To check which flags are currently enabled, go to | |
| <ConsoleLink route="project.settings.advanced" />. |
🧰 Tools
🪛 LanguageTool
[grammar] ~24-~24: Use a hyphen to join words.
Context: ...led the deprecated feature via a project level feature flag. To check which flags...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/kratos/deprecations/index.mdx` around lines 23 - 25, Replace the
unhyphenated compound adjective "project level" with the hyphenated form
"project-level" in the sentence that references the ConsoleLink component
(ConsoleLink route="project.settings.advanced") so the phrase reads "...unless
you have explicitly disabled the deprecated feature via a project-level feature
flag." This ensures consistent compound-adjective formatting across the
deprecations page.
| "https://console.ory.sh" + | ||
| resolvedRoute.replace("[project]", "current") + | ||
| (hash ? `#${hash}` : "") |
There was a problem hiding this comment.
Normalize and encode the fragment before appending it.
Passing hash through verbatim makes links brittle: hash="#section" renders ##section, and spaces/special characters are not encoded. Normalizing the leading # and encoding the fragment avoids malformed console links.
Suggested fix
const renderedRoute =
"https://console.ory.sh" +
resolvedRoute.replace("[project]", "current") +
- (hash ? `#${hash}` : "")
+ (hash ? `#${encodeURIComponent(hash.replace(/^#/, ""))}` : "")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "https://console.ory.sh" + | |
| resolvedRoute.replace("[project]", "current") + | |
| (hash ? `#${hash}` : "") | |
| "https://console.ory.sh" + | |
| resolvedRoute.replace("[project]", "current") + | |
| (hash ? `#${encodeURIComponent(hash.replace(/^#/, ""))}` : "") |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/ConsoleLink/console-link.tsx` around lines 65 - 67, The URL
builder currently appends the fragment verbatim causing double hashes and
unencoded characters; update the fragment handling where the URL is constructed
(using resolvedRoute and the hash variable) to first normalize by stripping any
leading '#' from hash, then apply encodeURIComponent to the normalized fragment,
and finally append it only if non-empty as `#${encodedFragment}` so spaces and
special characters are encoded and you never produce `##...`.
There was a problem hiding this comment.
Pull request overview
Adds a new Ory Kratos documentation page to track deprecated/changed behaviors, and wires it into the docs navigation. It also extends the ConsoleLink MDX component so docs can deep-link into specific sections of the Ory Console via URL fragments.
Changes:
- Add new
docs/kratos/deprecations/index.mdxpage describing feature deprecations / behavior changes. - Add the new page to the Kratos sidebar navigation.
- Extend
ConsoleLinkto accept an optionalhashfragment appended to the generated Console URL.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/sidebar.ts | Adds the new Kratos “Feature deprecations” doc to the sidebar. |
| src/components/ConsoleLink/console-link.tsx | Adds optional hash prop to support fragment navigation in Console links. |
| docs/kratos/deprecations/index.mdx | Introduces the “Feature deprecations” page and an initial entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -33,7 +34,7 @@ const flatConsolePaths = [...projectPaths, ...workspacesPaths].flatMap((p) => { | |||
| * @param route a (possible nested) accesor from the routes object | |||
There was a problem hiding this comment.
The JSDoc has a typo: "accesor" should be "accessor".
| * @param route a (possible nested) accesor from the routes object | |
| * @param route a (possible nested) accessor from the routes object |
| const renderedRoute = | ||
| "https://console.ory.sh" + resolvedRoute.replace("[project]", "current") | ||
| "https://console.ory.sh" + | ||
| resolvedRoute.replace("[project]", "current") + | ||
| (hash ? `#${hash}` : "") |
There was a problem hiding this comment.
hash is appended as #${hash} without any normalization/encoding. If a caller passes a value that already starts with # (or contains spaces/special chars), the resulting URL will be malformed. Consider stripping a leading # and applying encodeURIComponent to the fragment before concatenation.
| - Any recommended alternatives or migration paths, if applicable. | ||
|
|
||
| If you're using an Ory Network project, your configuration will not change, unless you have explicitly disabled the deprecated | ||
| feature via a project level feature flag. To check which flags are currently enabled, go to |
There was a problem hiding this comment.
Grammar: "project level" should be hyphenated as "project-level" when used as a compound modifier ("project-level feature flag").
| feature via a project level feature flag. To check which flags are currently enabled, go to | |
| feature via a project-level feature flag. To check which flags are currently enabled, go to |
| This improvement may impact users who are using the `/admin/sessions/{id}/extend` endpoint ([`extendSession`](../reference/api#tag/identity/operation/extendSession) SDK operation) to | ||
| extend their users' sessions. The new implementation may result in faster response times and improved performance when extending | ||
| sessions. | ||
|
|
||
| - Why was this change made? | ||
|
|
||
| The change was made to improve the performance and efficiency of the session extension process. By decoupling the session | ||
| extension from the retrieval of the updated session information, we can reduce the processing time and resource usage for | ||
| extending sessions, especially in scenarios with high traffic or large session data. | ||
|
|
||
| - How to adapt to this change? | ||
|
|
||
| If your application is using the updated session returned by the `/admin/sessions/{id}/extend` endpoint after the session | ||
| extension, you will need to update your implementation to retrieve the updated session information separately, using the | ||
| `/admin/sessions/{id}` endpoint ([`getSession`](../reference/api#tag/identity/operation/getSession) SDK operation) after the session extension. | ||
|
|
||
| After you reviewed your usage of this API, follow the instructions below based on your deployment type to ensure that you are | ||
| benefiting from the improved session extension process. | ||
|
|
||
| <Tabs> | ||
| <TabItem value="network" label="Ory Network"> | ||
| Go to <ConsoleLink route="project.settings.advanced" hash="kratos_feature_flags_faster_session_extend" /> and enable the | ||
| "Faster session extension" feature flag to benefit from this improvement. | ||
| </TabItem> | ||
| <TabItem value="self-hosted" label="Self-hosted (OSS or OEL)"> | ||
| Starting with [Ory Kratos v1.3.0](https://github.com/ory/kratos/releases/tag/v1.3.0), the faster session extension process is | ||
| enabled by default. If you need to disable this feature for any reason, you can set the `feature_flags.faster_session_extend` | ||
| configuration option to `false` in your Kratos configuration file. |
There was a problem hiding this comment.
This entry is framed as an "improvement" and focuses on "benefiting" from it, but the page is about deprecated behavior. It would be clearer to explicitly state what behavior is deprecated (e.g., relying on the extend endpoint returning the updated session) and, if known, the removal/default-change timeline so readers understand why they need to adapt.
| This improvement may impact users who are using the `/admin/sessions/{id}/extend` endpoint ([`extendSession`](../reference/api#tag/identity/operation/extendSession) SDK operation) to | |
| extend their users' sessions. The new implementation may result in faster response times and improved performance when extending | |
| sessions. | |
| - Why was this change made? | |
| The change was made to improve the performance and efficiency of the session extension process. By decoupling the session | |
| extension from the retrieval of the updated session information, we can reduce the processing time and resource usage for | |
| extending sessions, especially in scenarios with high traffic or large session data. | |
| - How to adapt to this change? | |
| If your application is using the updated session returned by the `/admin/sessions/{id}/extend` endpoint after the session | |
| extension, you will need to update your implementation to retrieve the updated session information separately, using the | |
| `/admin/sessions/{id}` endpoint ([`getSession`](../reference/api#tag/identity/operation/getSession) SDK operation) after the session extension. | |
| After you reviewed your usage of this API, follow the instructions below based on your deployment type to ensure that you are | |
| benefiting from the improved session extension process. | |
| <Tabs> | |
| <TabItem value="network" label="Ory Network"> | |
| Go to <ConsoleLink route="project.settings.advanced" hash="kratos_feature_flags_faster_session_extend" /> and enable the | |
| "Faster session extension" feature flag to benefit from this improvement. | |
| </TabItem> | |
| <TabItem value="self-hosted" label="Self-hosted (OSS or OEL)"> | |
| Starting with [Ory Kratos v1.3.0](https://github.com/ory/kratos/releases/tag/v1.3.0), the faster session extension process is | |
| enabled by default. If you need to disable this feature for any reason, you can set the `feature_flags.faster_session_extend` | |
| configuration option to `false` in your Kratos configuration file. | |
| This deprecation impacts users who rely on the `/admin/sessions/{id}/extend` endpoint | |
| ([`extendSession`](../reference/api#tag/identity/operation/extendSession) SDK operation) returning the updated session after | |
| extending a user's session. With `faster_session_extend` enabled, session extension is decoupled from returning the updated | |
| session data. | |
| - Why was this change made? | |
| The previous behavior was deprecated to improve the performance and efficiency of the session extension process. By decoupling | |
| session extension from retrieval of the updated session information, Ory Kratos can reduce processing time and resource usage, | |
| especially in scenarios with high traffic or large session data. | |
| - How to adapt to this change? | |
| If your application uses the updated session returned by the `/admin/sessions/{id}/extend` endpoint, update your implementation | |
| to retrieve the updated session separately after extending it by calling `/admin/sessions/{id}` | |
| ([`getSession`](../reference/api#tag/identity/operation/getSession) SDK operation). | |
| After reviewing your usage of this API, follow the instructions below based on your deployment type to adopt the non-deprecated | |
| behavior. | |
| <Tabs> | |
| <TabItem value="network" label="Ory Network"> | |
| Go to <ConsoleLink route="project.settings.advanced" hash="kratos_feature_flags_faster_session_extend" /> and enable the | |
| "Faster session extension" feature flag. | |
| </TabItem> | |
| <TabItem value="self-hosted" label="Self-hosted (OSS or OEL)"> | |
| Starting with [Ory Kratos v1.3.0](https://github.com/ory/kratos/releases/tag/v1.3.0), the faster session extension behavior | |
| is enabled by default. If your code still relies on `/admin/sessions/{id}/extend` returning the updated session, update it | |
| to call `getSession` separately, or temporarily set `feature_flags.faster_session_extend` to `false` in your Kratos | |
| configuration file. |
Related Issue or Design Document
Checklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
Further comments
Summary by CodeRabbit
Documentation
New Features
Chores