ci: make Document360 user id configurable via CI secret - #40881
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📜 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)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2026-04-14T23:26:16.284ZApplied to files:
🔇 Additional comments (1)
WalkthroughThe 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. ChangesDocument360 User ID Parameterization
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 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. 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. Comment |
There was a problem hiding this comment.
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
📒 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'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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>
| const D360_USER_ID = core.getInput('D360_USER_ID'); | |
| const D360_USER_ID = core.getInput('D360_USER_ID', { required: true }); |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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
595c409 to
86051a1
Compare
Proposed changes
The
Update Version DurabilityCI job crashes with an uncaughtAxiosError: Request failed with status code 400.Root cause
status === 3(published), so editing requires forking a draft first.user_idthat 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." }] }.PUT .../enthen returned 400 (article still locked without a draft), throwing an uncaught exception and failing the job.Changes
D360_USER_IDinput instead of hardcoding it (used in both fork and publish requests).D360_USER_IDthrough the action, the reusable workflow, and the CI caller as a required secret.Add a repository secret
D360_USER_IDwith a valid Document360 project user id before the next release run.Summary by CodeRabbit