Skip to content

ci: make Document360 user id configurable via CI secret - #40881

Merged
ggazzo merged 1 commit into
release-8.5.0from
fix/version-durability-user-id
Jun 10, 2026
Merged

ci: make Document360 user id configurable via CI secret#40881
ggazzo merged 1 commit into
release-8.5.0from
fix/version-durability-user-id

Conversation

@ggazzo

@ggazzo ggazzo commented Jun 10, 2026

Copy link
Copy Markdown
Member

Proposed changes

The Update Version Durability CI job crashes with an uncaught AxiosError: Request failed with status code 400.

Root cause

  1. The Document360 article is in status === 3 (published), so editing requires forking a draft first.
  2. The fork request used a hardcoded user_id that no longer exists in the Document360 project. Document360 returns HTTP 200 with { success: false, errors: [{ description: "The user with id '…' does not exist in your project." }] }.
  3. Since axios only throws on status >= 400, the failure was logged but execution continued.
  4. The article update PUT .../en then returned 400 (article still locked without a draft), throwing an uncaught exception and failing the job.

Changes

  • Read the user id from a new D360_USER_ID input instead of hardcoding it (used in both fork and publish requests).
  • Fail fast with a clear error when the fork request is unsuccessful, instead of proceeding to a doomed update.
  • Wire D360_USER_ID through the action, the reusable workflow, and the CI caller as a required secret.

⚠️ Required follow-up

Add a repository secret D360_USER_ID with a valid Document360 project user id before the next release run.

Summary by CodeRabbit

  • Chores
    • Improved document-publishing automation: added a required Document360 user ID configuration and stronger validation around fork/publish operations to reduce failures and surface clearer errors.

@ggazzo
ggazzo requested a review from a team as a code owner June 10, 2026 20:07
@dionisio-bot

dionisio-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 86051a1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0e19756e-1c5a-4d3e-9074-feaae3cbfcd0

📥 Commits

Reviewing files that changed from the base of the PR and between 595c409 and 86051a1.

📒 Files selected for processing (4)
  • .github/actions/update-version-durability/action.yml
  • .github/actions/update-version-durability/index.js
  • .github/workflows/ci.yml
  • .github/workflows/update-version-durability.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/actions/update-version-durability/index.js
  • .github/workflows/ci.yml
  • .github/workflows/update-version-durability.yml
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: 🔎 Code Check - Action Lint
  • GitHub Check: 🚀 Notify external services - draft
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-04-14T23:26:16.284Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40159
File: .github/actions/setup-node/action.yml:44-59
Timestamp: 2026-04-14T23:26:16.284Z
Learning: In this repo’s Rocket.Chat CI composite actions (e.g., .github/actions/setup-node/action.yml), treat direct writes of resolved tool versions to $GITHUB_ENV as an accepted/intentional pattern. If the action updates $GITHUB_ENV using something like `echo "VAR=value" >> $GITHUB_ENV` (without multiline heredoc form and without explicit empty-value guards), do not flag it as missing newline/empty validation or as “incorrect” heredoc usage. This is considered acceptable because the resolved versions come from trusted/stable sources (e.g., package.json engines and/or .tool-versions) used by Rocket.Chat CI.

Applied to files:

  • .github/actions/update-version-durability/action.yml
🔇 Additional comments (1)
.github/actions/update-version-durability/action.yml (1)

17-19: LGTM!


Walkthrough

The PR parameterizes the Document360 user ID by replacing a hardcoded UUID with a configurable secret passed through the GitHub Actions workflow chain. The change adds validation for fork API responses and flows the secret from the CI workflow through a reusable workflow to the action implementation.

Changes

Document360 User ID Parameterization

Layer / File(s) Summary
Action input declaration and constant initialization
.github/actions/update-version-durability/action.yml, .github/actions/update-version-durability/index.js
Action declares D360_USER_ID as a required input with description; implementation reads it into a module constant.
Document360 API calls with parameterized user ID and validation
.github/actions/update-version-durability/index.js
Fork and publish API requests use the parameterized D360_USER_ID. Fork request now validates success status and throws errors from the response.
Workflow secret declaration and input wiring
.github/workflows/update-version-durability.yml, .github/workflows/ci.yml
Reusable workflow declares D360_USER_ID as a required secret, forwards it to the action input, and the CI workflow passes it from the environment.

🎯 2 (Simple) | ⏱️ ~10 minutes


type: bug

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: making the Document360 user ID configurable via a CI secret instead of hardcoded.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ggazzo
ggazzo changed the base branch from develop to release-8.5.0 June 10, 2026 20:11
@ggazzo
ggazzo requested review from a team as code owners June 10, 2026 20:11
@ggazzo ggazzo changed the title fix: make Document360 user id configurable via CI secret ci: make Document360 user id configurable via CI secret Jun 10, 2026

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/actions/update-version-durability/index.js:
- Line 14: Validate that the D360_USER_ID input (obtained via
core.getInput('D360_USER_ID')) is non-empty immediately after retrieval; if it
is empty, call core.setFailed with a clear message (or throw a descriptive
Error) and exit so the action fails fast with actionable feedback instead of
letting the API call at Document360 fail later. Ensure the check is placed right
after the const D360_USER_ID = core.getInput('D360_USER_ID'); line and use the
same symbol name in the error message for clarity.
🪄 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

Run ID: cecf1911-bb33-48af-ba95-d0fca0f1207b

📥 Commits

Reviewing files that changed from the base of the PR and between cd55eb9 and 595c409.

📒 Files selected for processing (4)
  • .github/actions/update-version-durability/action.yml
  • .github/actions/update-version-durability/index.js
  • .github/workflows/ci.yml
  • .github/workflows/update-version-durability.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: 🚀 Notify external services - draft
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-04-14T23:26:16.284Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40159
File: .github/actions/setup-node/action.yml:44-59
Timestamp: 2026-04-14T23:26:16.284Z
Learning: In this repo’s Rocket.Chat CI composite actions (e.g., .github/actions/setup-node/action.yml), treat direct writes of resolved tool versions to $GITHUB_ENV as an accepted/intentional pattern. If the action updates $GITHUB_ENV using something like `echo "VAR=value" >> $GITHUB_ENV` (without multiline heredoc form and without explicit empty-value guards), do not flag it as missing newline/empty validation or as “incorrect” heredoc usage. This is considered acceptable because the resolved versions come from trusted/stable sources (e.g., package.json engines and/or .tool-versions) used by Rocket.Chat CI.

Applied to files:

  • .github/actions/update-version-durability/action.yml
📚 Learning: 2026-04-27T18:32:21.871Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40321
File: .github/workflows/ci.yml:137-145
Timestamp: 2026-04-27T18:32:21.871Z
Learning: In .github/workflows/ci.yml, the `diff` step under `release-versions` intentionally uses a bash `if` with `gh pr diff ... | grep -q ...; then ... fi`. For non-`pull_request` workflow triggers where `GH_PR_NUM` can be empty, the `gh` command may fail, but the surrounding bash `if` is relied on to treat that failure as the condition being false and skip the `then` block, allowing the step/job to exit cleanly. Do not add extra guards for non-PR event types unless this failure/skip behavior is intentionally changed.

Applied to files:

  • .github/workflows/ci.yml
🔇 Additional comments (4)
.github/actions/update-version-durability/action.yml (1)

17-19: LGTM!

.github/actions/update-version-durability/index.js (1)

197-197: LGTM!

Also applies to: 203-205, 219-219

.github/workflows/update-version-durability.yml (1)

15-16: LGTM!

Also applies to: 42-42

.github/workflows/ci.yml (1)

1103-1103: LGTM!


const D360_TOKEN = core.getInput('D360_TOKEN');
const D360_ARTICLE_ID = core.getInput('D360_ARTICLE_ID');
const D360_USER_ID = core.getInput('D360_USER_ID');

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate that D360_USER_ID is not empty.

If the repository secret D360_USER_ID is not configured, the input will be an empty string. The workflow would then fail at API call time (line 195) with a Document360 error rather than a clear validation error. Adding an upfront check provides immediate, actionable feedback.

✅ Proposed validation
 const D360_USER_ID = core.getInput('D360_USER_ID');
+if (!D360_USER_ID) {
+  throw new Error('D360_USER_ID input is required but was not provided');
+}
 const PUBLISH = core.getInput('PUBLISH') === 'true';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/update-version-durability/index.js at line 14, Validate that
the D360_USER_ID input (obtained via core.getInput('D360_USER_ID')) is non-empty
immediately after retrieval; if it is empty, call core.setFailed with a clear
message (or throw a descriptive Error) and exit so the action fails fast with
actionable feedback instead of letting the API call at Document360 fail later.
Ensure the check is placed right after the const D360_USER_ID =
core.getInput('D360_USER_ID'); line and use the same symbol name in the error
message for clarity.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/actions/update-version-durability/index.js">

<violation number="1" location=".github/actions/update-version-durability/index.js:14">
P2: Missing `{ required: true }` option on `core.getInput('D360_USER_ID')`. Since D360_USER_ID is a required secret (per PR description), omitting the `required` flag means an unset secret produces a misleading Document360 API error instead of a clear startup failure.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic


const D360_TOKEN = core.getInput('D360_TOKEN');
const D360_ARTICLE_ID = core.getInput('D360_ARTICLE_ID');
const D360_USER_ID = core.getInput('D360_USER_ID');

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.

P2: Missing { required: true } option on core.getInput('D360_USER_ID'). Since D360_USER_ID is a required secret (per PR description), omitting the required flag means an unset secret produces a misleading Document360 API error instead of a clear startup failure.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/actions/update-version-durability/index.js, line 14:

<comment>Missing `{ required: true }` option on `core.getInput('D360_USER_ID')`. Since D360_USER_ID is a required secret (per PR description), omitting the `required` flag means an unset secret produces a misleading Document360 API error instead of a clear startup failure.</comment>

<file context>
@@ -11,6 +11,7 @@ import { Octokit } from '@octokit/rest';
 
 const D360_TOKEN = core.getInput('D360_TOKEN');
 const D360_ARTICLE_ID = core.getInput('D360_ARTICLE_ID');
+const D360_USER_ID = core.getInput('D360_USER_ID');
 const PUBLISH = core.getInput('PUBLISH') === 'true';
 const LTS_VERSIONS = (core.getInput('LTS_VERSIONS') || '7.10').split(',').map((v) => v.trim());
</file context>
Suggested change
const D360_USER_ID = core.getInput('D360_USER_ID');
const D360_USER_ID = core.getInput('D360_USER_ID', { required: true });

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.88%. Comparing base (efdefa6) to head (86051a1).
⚠️ Report is 2 commits behind head on release-8.5.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.5.0   #40881      +/-   ##
=================================================
- Coverage          69.90%   69.88%   -0.02%     
=================================================
  Files               3328     3328              
  Lines             126801   126801              
  Branches           22038    22045       +7     
=================================================
- Hits               88642    88621      -21     
- Misses             34858    34876      +18     
- Partials            3301     3304       +3     
Flag Coverage Δ
unit 69.95% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The hardcoded user id no longer exists in the Document360 project,
causing the fork request to fail silently (HTTP 200 with success:false)
and the subsequent article update to return 400.

- Read user id from D360_USER_ID input instead of hardcoding it
- Fail fast when the fork request is unsuccessful
@ggazzo
ggazzo force-pushed the fix/version-durability-user-id branch from 595c409 to 86051a1 Compare June 10, 2026 20:15
@ggazzo
ggazzo merged commit f3fc9df into release-8.5.0 Jun 10, 2026
9 of 11 checks passed
@ggazzo
ggazzo deleted the fix/version-durability-user-id branch June 10, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants