Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archive (1.3) exclude: remove versions 1.3 and 3.7.0, part 1: reviewable steps #2502

Closed
9 changes: 4 additions & 5 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const versionedLinks = require("./src/mdx/versionedLinks");
const { unsupportedVersions } = require("./src/versions");

module.exports = {
title: "Camunda Platform 8 Docs",
Expand Down Expand Up @@ -87,9 +88,9 @@ module.exports = {
className: "dropdown-unsupported-versions",
value: "<b>Unsupported versions</b>",
},
...["1.2", "1.1", "1.0", "0.26", "0.25"].map((version) => ({
label: version,
href: `https://unsupported.docs.camunda.io/${version}/`,
...unsupportedVersions.map((version) => ({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved these to a separate file because I wanted to type the array items, and I didn't want to clutter this already-large config.

label: version.label,
href: `https://unsupported.docs.camunda.io/${version.urlSuffix}/`,
})),
],
},
Expand Down Expand Up @@ -256,10 +257,8 @@ module.exports = {
"/docs/**/assets/**",
"/docs/**/tags/**",
"/docs/next/**",
"/docs/1.3/**",
"/docs/8.0/**",
"/docs/8.1/**",
"/optimize/3.7.0/**",
"/optimize/3.8.0/**",
"/optimize/3.9.0/**",
"/optimize/next/**",
Expand Down
2 changes: 1 addition & 1 deletion hacks/isolateVersion/8-configureOptimizeDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sed -i '' "/^const versionMappings = \[$/,/\];/c\\
const versionMappings = [\\
{ docsVersion: \"$ARCHIVED_VERSION\", optimizeVersion: \"$ARCHIVED_OPTIMIZE_VERSION\" },\\
];\\
" src/mdx/expandVersionedUrl.js
" src/versions.js
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these versionMappings were moved to the same file as the new unsupportedVersions, because they are all about versions.


# remove hard-coded versions from main docs sidebar configuration
sed -i '' "s/optimize\/$ARCHIVED_OPTIMIZE_VERSION\//optimize\//g" versioned_sidebars/version-$ARCHIVED_VERSION-sidebars.json
Expand Down
4 changes: 2 additions & 2 deletions howtos/release-procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To create the new versions:
> ./hacks/cutNewVersions.sh
```

4. Add a record correlating the two versions to [`src/mdx/expandVersionedUrl.js`](../src/mdx/expandVersionedUrl.js#L20-L27).
4. Add a record correlating the two versions to [`src/versions.js`](../src/versions.js#L16-L30).

- The `versionMappings` variable maps Optimize versions to main docs versions:

Expand All @@ -63,7 +63,7 @@ To create the new versions:
];
```

- Add the new mapping in the first position of the array.
- Order of the items in the array is important. Add the new mapping in the first position of the array, because the first item is treated as the "current" version mapping.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added this note because I think it's important. I only noticed it missing because I was editing the docs right above.

Copy link
Member

Choose a reason for hiding this comment

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

Solid add!


5. Ensure the "unmaintained" banner does not appear for supported versions. We currently support all versions of Camunda Platform 8 since none are older than 18 months.

Expand Down
2 changes: 1 addition & 1 deletion optimize_versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["3.10.0", "3.9.0", "3.8.0", "3.7.0"]
["3.10.0", "3.9.0", "3.8.0"]
23 changes: 1 addition & 22 deletions src/mdx/expandVersionedUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
// Note: these type definitions are only checked within an editor. We aren't set up
// for type-checking in the build (yet!) but having these types defined helped me write this code.
/**
* @typedef {object} VersionMapping
* @property {string} docsVersion
* @property {string} optimizeVersion
*
* @typedef {object} Token
* @property {string} token
* @property {Array<TokenRule>} rules
Expand All @@ -16,24 +12,7 @@
* @property {string} expandTo
*/

/** @type {Array<VersionMapping>} */
const versionMappings = [
// 👋 When cutting a new version, add a new mapping here!
{
docsVersion: "8.2",
optimizeVersion: "3.10.0",
},
{
docsVersion: "8.1",
optimizeVersion: "3.9.0",
},
{
docsVersion: "8.0",
optimizeVersion: "3.8.0",
},
{ docsVersion: "1.3", optimizeVersion: "3.7.0" },
];

const { versionMappings } = require("../versions.js");
const [currentVersions, ...remainingVersions] = versionMappings;

/** @type {Token} */
Expand Down
46 changes: 46 additions & 0 deletions src/versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// @ts-check

// Note: these type definitions are only checked within an editor. We aren't set up
// for type-checking in the build (yet!) but having these types defined helped me write this code.
/**
* @typedef {object} VersionMapping
* @property {string} docsVersion
* @property {string} optimizeVersion
*
* @typedef {object} UnsupportedVersion
* @property {string} label
* @property {string} urlSuffix
*/

/** @type {Array<VersionMapping>} */
const versionMappings = [
// 👋 When cutting a new version, add a new mapping here!
{
docsVersion: "8.2",
optimizeVersion: "3.10.0",
},
{
docsVersion: "8.1",
optimizeVersion: "3.9.0",
},
{
docsVersion: "8.0",
optimizeVersion: "3.8.0",
},
];

/** @type {Array<UnsupportedVersion>} */
const unsupportedVersions = [
// 👋 When archiving a version, move it from the above array into here, and edit it!
{ label: "1.3 / 3.7.0", urlSuffix: "1.3" },
{ label: "1.2", urlSuffix: "1.2" },
{ label: "1.1", urlSuffix: "1.1" },
{ label: "1.0", urlSuffix: "1.0" },
{ label: "0.26", urlSuffix: "0.26" },
{ label: "0.25", urlSuffix: "0.25" },
];

module.exports = {
versionMappings,
unsupportedVersions,
};
14 changes: 2 additions & 12 deletions static/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ RewriteRule ^docs/apis-clients(.*)$ /docs/apis-tools$1 [R=301,L]
RewriteRule ^optimize/apis-clients(.*)$ /optimize/apis-tools$1 [R=301,L]
RewriteRule ^docs/8.0/apis-clients(.*)$ /docs/8.0/apis-tools$1 [R=301,L]
RewriteRule ^optimize/3.8.0/apis-clients(.*)$ /optimize/3.8.0/apis-tools$1 [R=301,L]
RewriteRule ^docs/1.3/apis-clients(.*)$ /docs/1.3/apis-tools$1 [R=301,L]

# Identity Authorizations
RewriteRule ^docs/next/self-managed/identity/user-guide/groups/creating-authorizations-for-a-group/(.*)$ /docs/next/self-managed/identity/user-guide/authorizations/managing-resource-authorizations/ [R=301,L]
Expand Down Expand Up @@ -223,8 +222,6 @@ RewriteRule ^docs/guides/implementing-connectors$ /docs/guides/configuring-out-o
RewriteRule ^docs/8.0/guides/implementing-connectors/(.*)$ /docs/8.0/guides/configuring-out-of-the-box-connectors/$1 [R=301,L]
RewriteRule ^docs/8.0/guides/implementing-connectors$ /docs/8.0/guides/configuring-out-of-the-box-connectors/ [R=301,L]

RewriteRule ^docs/1.3/self-managed/overview/(.*)$ /docs/1.3/self-managed/about-self-managed/$1 [R=301,L]
RewriteRule ^docs/1.3/self-managed/overview$ /docs/1.3/self-managed/about-self-managed/ [R=301,L]
RewriteRule ^docs/self-managed/overview/(.*)$ /docs/self-managed/about-self-managed/$1 [R=301,L]
RewriteRule ^docs/self-managed/overview$ /docs/self-managed/about-self-managed/ [R=301,L]

Expand All @@ -244,8 +241,6 @@ RewriteRule ^docs/self-managed/operate-deployment/authentication/(.*)$ /docs/sel
RewriteRule ^docs/self-managed/identity/troubleshooting/?$ /docs/self-managed/identity/troubleshooting/troubleshoot-identity/ [R=301,L]
RewriteRule ^docs/self-managed/identity/getting-started/?$ /docs/self-managed/identity/getting-started/install-identity/ [R=301,L]

RewriteRule ^docs/1.3/components/overview/(.*)$ /docs/1.3/components/components-overview/$1 [R=301,L]
RewriteRule ^docs/1.3/components/overview$ /docs/1.3/components/components-overview/ [R=301,L]
RewriteRule ^docs/components/overview/(.*)$ /docs/components/components-overview/$1 [R=301,L]
RewriteRule ^docs/components/overview$ /docs/components/components-overview/ [R=301,L]

Expand All @@ -269,8 +264,6 @@ RewriteRule ^docs/components/console/troubleshooting$ /docs/components/console/c
RewriteRule ^docs/components/best-practices/overview/(.*)$ /docs/components/best-practices/best-practices-overview/$1 [R=301,L]
RewriteRule ^docs/components/best-practices/overview$ /docs/components/best-practices/best-practices-overview [R=301,L]

RewriteRule ^docs/1.3/apis-clients/overview/(.*)$ /docs/1.3/apis-tools/working-with-apis-tools/$1 [R=301,L]
RewriteRule ^docs/1.3/apis-clients/overview$ /docs/1.3/apis-tools/working-with-apis-tools [R=301,L]
RewriteRule ^docs/apis-clients/overview/(.*)$ /docs/apis-tools/working-with-apis-tools/$1 [R=301,L]
RewriteRule ^docs/apis-clients/overview$ /docs/apis-tools/working-with-apis-tools [R=301,L]
RewriteRule ^docs/apis-clients/tasklist-api/tutorial/(.*)$ /docs/apis-clients/tasklist-api/tasklist-api-tutorial/$1 [R=301,L]
Expand Down Expand Up @@ -516,17 +509,14 @@ RewriteRule ^docs/self-managed/optimize-deployment/(.*)$ /optimize/self-managed/
RewriteRule ^docs/next/apis-clients/optimize-api/(.*)$ /optimize/next/apis-clients/optimize-api/$1 [R=301,L]
RewriteRule ^docs/apis-clients/optimize-api/(.*)$ /optimize/apis-clients/optimize-api/$1 [R=301,L]

## optimize extraction for version 3.7.0:
RewriteRule ^docs/1.3/components/optimize/what-is-optimize(\/?)$ /optimize/3.7.0/components/what-is-optimize/ [R=301,L]
RewriteRule ^docs/1.3/components/optimize/userguide/(.*)$ /optimize/3.7.0/components/userguide/$1 [R=301,L]
RewriteRule ^docs/1.3/self-managed/optimize-deployment/(.*)$ /optimize/3.7.0/self-managed/optimize-deployment/$1 [R=301,L]

## Archived versions. Note that the URL is adjusted to staging in the publish-stage workflow.
RewriteRule ^docs/0.25/(.*)$ https://unsupported.docs.camunda.io/0.25/docs/$1 [R=301,L]
RewriteRule ^docs/0.26/(.*)$ https://unsupported.docs.camunda.io/0.26/docs/$1 [R=301,L]
RewriteRule ^docs/1.0/(.*)$ https://unsupported.docs.camunda.io/1.0/docs/$1 [R=301,L]
RewriteRule ^docs/1.1/(.*)$ https://unsupported.docs.camunda.io/1.1/docs/$1 [R=301,L]
RewriteRule ^docs/1.2/(.*)$ https://unsupported.docs.camunda.io/1.2/docs/$1 [R=301,L]
RewriteRule ^docs/1.3/(.*)$ https://unsupported.docs.camunda.io/1.3/docs/$1 [R=301,L]
RewriteRule ^optimize/3.7.0/(.*)$ https://unsupported.docs.camunda.io/1.3/optimize/$1 [R=301,L]

# Add yaml mime type
AddType text/vnd.yaml yaml
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["8.2", "8.1", "8.0", "1.3"]
["8.2", "8.1", "8.0"]