ci: migrate uploads to official Nexus-Mods/upload-action#2405
Conversation
… inis Placeholder IDs (000000) — replace with real file_group_id values from each mod's Nexus Files tab (three-dot menu → API Info) before first upload.
📝 WalkthroughWalkthroughAdds per-feature Nexus file-group IDs, parses them in the audit tool, attaches them to the upload matrix, introduces a ChangesNexus file group ID support
Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant ArtifactStorage
participant NexusAPI
participant NexusModsUploadAction
GitHubActions->>ArtifactStorage: download prepared .7z artifact
GitHubActions->>NexusAPI: query existing versions for mod
GitHubActions->>NexusModsUploadAction: invoke upload (file_group_id, .7z, description, api key)
NexusModsUploadAction->>NexusAPI: perform file upload
NexusModsUploadAction-->>GitHubActions: return upload success/failure
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 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 unit tests (beta)
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: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tools/feature_version_audit.py (1)
961-988:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winCore row missing
file_group_idfield.According to the review stack context, the core row should include a
file_group_idfield populated from workflow input, but the current implementation does not set this field. The PR description indicates the core mod should have file_group_id3119152.Without this field, the upload action will likely fail or upload to an incorrect file group.
🔧 Proposed fix
Add a
core_file_group_idparameter to the function signature:-def build_nexus_upload_matrix(feature_metadata, core_mod_id, core_filename, core_artifact_pattern, base_ref=None, release_version=None): +def build_nexus_upload_matrix(feature_metadata, core_mod_id, core_filename, core_artifact_pattern, base_ref=None, release_version=None, core_file_group_id=''):Add the field to the core row:
rows = [ { 'name': 'core', 'artifact_pattern': core_artifact_pattern, 'artifact_name': 'nexus-upload-core', 'nexus_mod_id': core_mod_id, 'mod_filename': core_filename, 'changelog': '', # filled by workflow from GitHub release body 'file_description': core_description, + 'file_group_id': core_file_group_id, } ]Add a command-line argument (around line 1191):
parser.add_argument('--core-file-group-id', type=str, default='3119152', help='Core Nexus file group ID for the generated upload matrix')Pass the argument to the function call (around line 1252):
matrix = build_nexus_upload_matrix( export_features, args.core_mod_id, args.core_filename, args.core_artifact_pattern, base_ref=base_ref, release_version=args.release_version, + core_file_group_id=args.core_file_group_id, )🤖 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 `@tools/feature_version_audit.py` around lines 961 - 988, The core row in build_nexus_upload_matrix is missing the required 'file_group_id' so add a new parameter core_file_group_id to build_nexus_upload_matrix and set the core row's 'file_group_id' to that parameter (i.e. add 'file_group_id': core_file_group_id in the dict for the 'core' row); also add a CLI argument parser.add_argument('--core-file-group-id', type=str, default='3119152', help='Core Nexus file group ID for the generated upload matrix') and pass that parsed value into the build_nexus_upload_matrix call where it's invoked so the core row is populated from workflow input.
🧹 Nitpick comments (2)
features/Wetness Effects/Shaders/Features/WetnessEffects.ini (1)
6-6: ⚡ Quick winPR metadata suggestion: add explicit issue linkage in description.
Title already follows Conventional Commits (
ci: ...). If this change resolves a tracked upload reliability bug, add a keyword reference likeFixes #<id>(orAddresses #<id>) in the PR description for traceability.As per coding guidelines, "Issue References ... Suggest adding appropriate GitHub keywords: 'Fixes
#123' or 'Closes#123' for bug fixes."🤖 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 `@features/Wetness` Effects/Shaders/Features/WetnessEffects.ini at line 6, The PR description is missing an explicit issue linkage; update the PR description to include a GitHub keyword like "Fixes #<issue-number>" or "Closes #<issue-number>" if this change (related to nexusfilegroupid = 3176515 in Features/Wetness Effects/Shaders/Features/WetnessEffects.ini) resolves the tracked upload reliability bug so the commit (ci: ...) is traceable; ensure the keyword and correct issue number are added to the PR body.tools/feature_version_audit.py (1)
1033-1042: ⚡ Quick winConsider validating
file_group_idfor auto-upload features.Features with
auto_upload=Truerequire a validfile_group_idfor the upload to succeed. Currently, iffile_group_idis missing from the INI, the matrix row will have an empty string, which could cause runtime upload failures.Adding validation would catch configuration errors early and provide a clearer error message.
✅ Proposed validation
Add validation after line 1042:
row = { 'name': name, 'artifact_pattern': artifact_pattern, 'artifact_name': f'nexus-upload-{sanitize_name(name)}', 'nexus_mod_id': mod_id, 'mod_filename': mod_filename, 'auto_upload': auto_upload, 'file_description': file_description, 'file_group_id': ini_metadata.get('file_group_id', ''), } + # Validate file_group_id is present for auto-upload features + if auto_upload and not row['file_group_id']: + print(f"Warning: Feature '{name}' has auto_upload=True but missing file_group_id", file=sys.stderr) + if mod_version: row['mod_version'] = mod_version🤖 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 `@tools/feature_version_audit.py` around lines 1033 - 1042, The row-building code sets 'file_group_id' to ini_metadata.get('file_group_id', '') but doesn't validate it for auto-upload; update the logic after the row is created (or immediately before it's used) to check if auto_upload is True and the 'file_group_id' value is empty/invalid, and if so raise a clear ValueError or log and skip—refer to the variables/keys 'auto_upload' and 'file_group_id' and the dict 'row' so you locate the code that constructs the row (and any caller that performs the upload) and enforce/validate that a non-empty file_group_id exists before proceeding.
🤖 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/workflows/nexus-upload.yaml:
- Around line 467-476: The EXISTING check uses the Python snippet to scan all
files' versions, which can be fooled by archived/optional files; update the
Python filter inside the curl pipeline so it only collects versions from files
belonging to the MAIN category (e.g. change the list comprehension in the
snippet used to build "versions" to include only entries where f.get('category')
== 'MAIN' or f.get('category_name') == 'MAIN' depending on the API key used),
then print true/false as before; keep the overall curl || echo "false" behavior
intact so behavior on API errors is unchanged.
- Around line 505-517: The Upload to Nexus step passes matrix.file_group_id
directly and can fail late with poor context; add a preceding guard step (e.g.,
name "Validate file_group_id") that checks the matrix.file_group_id value and
fails fast if it is empty, null, or a known placeholder like "000000" (use an
exit 1 with a clear message). Place this validation step before the step with id
"upload" so the workflow stops early and provides a helpful error; ensure the
guard uses the same matrix expression (matrix.file_group_id) and does not set
continue-on-error so failures are deterministic.
In `@features/Grass` Collision/Shaders/Features/GrassCollision.ini:
- Line 6: Replace the placeholder nexusfilegroupid value "000000" with the real
Nexus file group ID before enabling autoupload; locate the nexusfilegroupid
entry in Features/Grass Collision/Shaders/Features/GrassCollision.ini and set it
to the actual numeric/hex group ID used by your Nexus account (and verify
autoupload = true is intended), so uploads are categorized correctly and avoid
failures.
In `@features/Sky` Sync/Shaders/Features/SkySync.ini:
- Line 6: Replace the placeholder value for nexusfilegroupid (currently
"000000") with the real file group ID used by the matrix-driven Nexus upload
path; update the nexusfilegroupid setting to the correct ID string in the
SkySync.ini entry, ensure the value uses the exact expected format for Nexus (no
extra whitespace or quotes), and commit the change so the placeholder is not
left in the config.
In `@features/Subsurface` Scattering/Shaders/Features/SubsurfaceScattering.ini:
- Line 6: Replace the placeholder nexusfilegroupid value ("000000") in
SubsurfaceScattering.ini with the actual Nexus file group ID used by your
project's upload workflow; locate the line containing the nexusfilegroupid
setting and update its value to the correct numeric or alphanumeric ID so upload
routing will use the proper group instead of the placeholder.
In `@features/Terrain` Helper/Shaders/Features/TerrainHelper.ini:
- Line 6: The nexusfilegroupid entry currently uses the placeholder value
"000000"; update the nexusfilegroupid setting in Features/Terrain
Helper/Shaders/Features/TerrainHelper.ini (the nexusfilegroupid key) to the
actual Nexus file group ID provided for this project before enabling live
uploads so it no longer contains the placeholder value.
---
Outside diff comments:
In `@tools/feature_version_audit.py`:
- Around line 961-988: The core row in build_nexus_upload_matrix is missing the
required 'file_group_id' so add a new parameter core_file_group_id to
build_nexus_upload_matrix and set the core row's 'file_group_id' to that
parameter (i.e. add 'file_group_id': core_file_group_id in the dict for the
'core' row); also add a CLI argument parser.add_argument('--core-file-group-id',
type=str, default='3119152', help='Core Nexus file group ID for the generated
upload matrix') and pass that parsed value into the build_nexus_upload_matrix
call where it's invoked so the core row is populated from workflow input.
---
Nitpick comments:
In `@features/Wetness` Effects/Shaders/Features/WetnessEffects.ini:
- Line 6: The PR description is missing an explicit issue linkage; update the PR
description to include a GitHub keyword like "Fixes #<issue-number>" or "Closes
#<issue-number>" if this change (related to nexusfilegroupid = 3176515 in
Features/Wetness Effects/Shaders/Features/WetnessEffects.ini) resolves the
tracked upload reliability bug so the commit (ci: ...) is traceable; ensure the
keyword and correct issue number are added to the PR body.
In `@tools/feature_version_audit.py`:
- Around line 1033-1042: The row-building code sets 'file_group_id' to
ini_metadata.get('file_group_id', '') but doesn't validate it for auto-upload;
update the logic after the row is created (or immediately before it's used) to
check if auto_upload is True and the 'file_group_id' value is empty/invalid, and
if so raise a clear ValueError or log and skip—refer to the variables/keys
'auto_upload' and 'file_group_id' and the dict 'row' so you locate the code that
constructs the row (and any caller that performs the upload) and
enforce/validate that a non-empty file_group_id exists before proceeding.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 10114282-cd2c-4796-b20a-9fff78b91640
📒 Files selected for processing (18)
.github/workflows/nexus-upload.yaml.github/workflows/release-build.yamlfeatures/Cloud Shadows/Shaders/Features/CloudShadows.inifeatures/Grass Collision/Shaders/Features/GrassCollision.inifeatures/Grass Lighting/Shaders/Features/GrassLighting.inifeatures/HDR Display/Shaders/Features/HDRDisplay.inifeatures/Hair Specular/Shaders/Features/HairSpecular.inifeatures/Screen Space GI/Shaders/Features/ScreenSpaceGI.inifeatures/Screen-Space Shadows/Shaders/Features/ScreenSpaceShadows.inifeatures/Sky Sync/Shaders/Features/SkySync.inifeatures/Skylighting/Shaders/Features/Skylighting.inifeatures/Subsurface Scattering/Shaders/Features/SubsurfaceScattering.inifeatures/Terrain Blending/Shaders/Features/TerrainBlending.inifeatures/Terrain Helper/Shaders/Features/TerrainHelper.inifeatures/Terrain Variation/Shaders/Features/TerrainVariation.inifeatures/Upscaling/Shaders/Features/Upscaling.inifeatures/Wetness Effects/Shaders/Features/WetnessEffects.initools/feature_version_audit.py
💤 Files with no reviewable changes (1)
- .github/workflows/release-build.yaml
CORE features are bundled with the main mod and never uploaded individually to Nexus. The [Nexus] section in their ini files was unreachable dead config — the matrix builder skips any feature where IsCore() returns true. Removing it prevents confusion about whether these features have separate Nexus pages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Actionable Suggestions
|
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 `@tools/feature_version_audit.py`:
- Around line 1033-1038: The current preflight only warns when
ini_metadata.get('file_group_id') is empty; update the check around the
variables file_group_id and auto_upload (where file_group_id =
ini_metadata.get('file_group_id', '') and if auto_upload ...) to also treat the
known placeholder ID "000000" as missing: trim whitespace from file_group_id and
if auto_upload is true and (file_group_id == '' or file_group_id == '000000')
emit the same stderr warning so placeholder IDs are caught during matrix
generation.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7bd1302a-c10e-479a-ba7f-0a4b9dc2b650
📒 Files selected for processing (2)
.github/workflows/nexus-upload.yamltools/feature_version_audit.py
There was a problem hiding this comment.
♻️ Duplicate comments (1)
tools/feature_version_audit.py (1)
1034-1038:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate warning message to reflect both missing and placeholder cases.
The validation condition correctly checks for both empty and
'000000'placeholder values, but the warning message still says "is not set" which doesn't accurately describe the placeholder case.📝 Suggested fix
if auto_upload and (not file_group_id or file_group_id == '000000'): print( - f"WARNING: {name} has auto_upload=true but nexusfilegroupid is not set in its [Nexus] ini section.", + f"WARNING: {name} has auto_upload=true but nexusfilegroupid is missing or a placeholder in its [Nexus] ini section.", file=sys.stderr, )🤖 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 `@tools/feature_version_audit.py` around lines 1034 - 1038, The warning text for the auto-upload check should reflect both missing and placeholder values: update the message in the block that checks "if auto_upload and (not file_group_id or file_group_id == '000000')" so it no longer says "is not set" but instead indicates "is not set or is the placeholder '000000'" (include the variable names name and file_group_id in the message for clarity). Keep the same stderr printing behavior (print(..., file=sys.stderr)) and preserve the surrounding logic.
🤖 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.
Duplicate comments:
In `@tools/feature_version_audit.py`:
- Around line 1034-1038: The warning text for the auto-upload check should
reflect both missing and placeholder values: update the message in the block
that checks "if auto_upload and (not file_group_id or file_group_id ==
'000000')" so it no longer says "is not set" but instead indicates "is not set
or is the placeholder '000000'" (include the variable names name and
file_group_id in the message for clarity). Keep the same stderr printing
behavior (print(..., file=sys.stderr)) and preserve the surrounding logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 531c1c9e-a161-444b-8844-3752c70e6bd8
📒 Files selected for processing (1)
tools/feature_version_audit.py
|
the feature ini comment is not relevant as this is being generated due to an improper tag of 1.5.2. will resolve itself when 1.6 is released. |
61675d5
into
community-shaders:dev
Summary
alandtse/nexus-workflows(session cookie auth) with theofficial
Nexus-Mods/upload-action@v1.0.0-beta.5, eliminating uploadfailures caused by expired session cookies
nexusfilegroupidto all 15 auto-upload feature.inifiles andthreads it through
feature_version_audit.pyinto the upload matrixthe mod name, version, file group ID, and artifact name for manual recovery
Notes
UNEX_NEXUSMODS_SESSION_COOKIEsecret can be deleted from repo settingsUNEX_APIKEYis unchanged and now serves dual purpose: version checkingand upload authentication
.ininexusfilegroupidvalues are real IDs — verify beforefirst live upload
Summary by CodeRabbit