Repository navigation
feat(worldedit): add nexus-worldedit module -- WE/FAWE facade + SchematicService - #10
Conversation
|
Warning Review limit reached
More reviews will be available in 58 minutes and 38 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
WalkthroughAdds a nexus-worldedit subproject with build/config, a SchematicService interface (capture/restore with sealed Result), WorldEditAdapter for schematic I/O, and CI changes: Detekt plugin/config and a CI job wired into the publish workflow. ChangesWorldEdit integration
CI and static analysis
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 4 high |
| CodeStyle | 1 minor |
| Complexity | 1 medium 1 minor |
🟢 Metrics -25 complexity · -1 duplication
Metric Results Complexity -25 Duplication -1
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 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 `@nexus-worldedit/build.gradle.kts`:
- Line 18: The Paper API dependency in build.gradle.kts is targeting the wrong
snapshot version; change the compileOnly dependency declaration that references
io.papermc.paper:paper-api (the compileOnly(...) line) to use
1.21.1-R0.1-SNAPSHOT if the PR intends to target 1.21.1, or alternatively update
the PR description/objective to state 1.21.11 if you intend to keep
1.21.11-R0.1-SNAPSHOT so the declared version and PR objective match.
In
`@nexus-worldedit/src/main/kotlin/net/badgersmc/nexus/worldedit/SchematicService.kt`:
- Around line 11-12: The interface SchematicService currently takes a
regionId:String for capture and restore but provides no way to resolve that ID
to WorldEdit BlockVector3 coordinates; update the contract so implementers can
obtain region bounds: either (A) add a dependency parameter to the interface
(e.g., a RegionResolver or RegionRegistry) and change the signatures of
capture/restore to accept that resolver or require the resolver via constructor,
documenting the expected regionId format and lookup behavior, or (B) replace
regionId:String with explicit coordinate parameters (min: BlockVector3, max:
BlockVector3) or provide overloaded methods capture(regionId:String,
world:World, outputFile:File, resolver:RegionResolver) and
capture(min:BlockVector3, max:BlockVector3, world:World, outputFile:File) (and
equivalent restore overloads) so callers can supply concrete BlockVector3
bounds; ensure Result-returning methods are updated to reference these new
parameters and document the resolution contract if keeping regionId.
In
`@nexus-worldedit/src/main/kotlin/net/badgersmc/nexus/worldedit/WorldEditAdapter.kt`:
- Around line 20-26: The lazy property isFawePresent in WorldEditAdapter.kt is
computed but never used; either remove the property or make its intent explicit:
if it’s meant for external callers keep it public and add KDoc explaining its
purpose (e.g., "True if FastAsyncWorldEdit is loaded; exposed for plugins to
check FAWE presence") or mark it internal/private or add a TODO comment for
planned FAWE-specific behavior; update or remove the property accordingly so no
unused symbol remains.
- Line 36: In WorldEditAdapter, replace the unchecked call to
file.parentFile?.mkdirs() with an explicit check: call file.parentFile?.let { if
(!it.exists() && !it.mkdirs()) throw IOException("Failed to create parent
directory for ${file.name} at ${it.path}") } (or log and rethrow) before calling
file.outputStream(); this ensures mkdirs() failures are detected and surfaces a
clear error instead of letting file.outputStream() fail later.
- Line 18: The private val log declared in WorldEditAdapter
(Logger.getLogger(WorldEditAdapter::class.java.name)) is unused; remove this
unused property or start using it in methods that need logging. Locate the 'log'
field in the WorldEditAdapter class and either delete the declaration or replace
usages where debugging/info/error messages are appropriate (e.g., inside
functions that handle WorldEdit events or adapter initialization) by calling
log.info/log.warning/log.severe as needed to surface runtime details.
- Around line 5-9: Remove the unused imports from WorldEditAdapter.kt: delete
the unused BlockVector3, Plugin, and Logger import statements so only actually
referenced imports remain (e.g., keep org.bukkit.World and java.io.File if
used); update the import block accordingly to eliminate unused imports and run a
quick build/lint to confirm no remaining unused symbols.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 86a577e6-6bdb-4a52-8d44-ea4025027002
📒 Files selected for processing (4)
nexus-worldedit/build.gradle.ktsnexus-worldedit/src/main/kotlin/net/badgersmc/nexus/worldedit/SchematicService.ktnexus-worldedit/src/main/kotlin/net/badgersmc/nexus/worldedit/WorldEditAdapter.ktsettings.gradle.kts
|
|
||
| dependencies { | ||
| api(project(":nexus-core")) | ||
| compileOnly("io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT") |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check available Paper API versions for 1.21.x in the PaperMC repository
curl -s 'https://repo.papermc.io/service/rest/v1/search?repository=maven-public&group=io.papermc.paper&name=paper-api&maven.baseVersion=1.21.1' | jq -r '.items[].version' | head -10Repository: BadgersMC/Nexus
Length of output: 182
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== nexus-worldedit/build.gradle.kts (around line 18) =="
nl -ba nexus-worldedit/build.gradle.kts | sed -n '1,60p'
echo
echo "== PaperMC repo search: baseVersion=1.21.1 (raw first 500 chars) =="
URL='https://repo.papermc.io/service/rest/v1/search?repository=maven-public&group=io.papermc.paper&name=paper-api&maven.baseVersion=1.21.1'
curl -sS "$URL" | head -c 500; echo
echo
echo "== PaperMC repo search: baseVersion=1.21.11 (raw first 500 chars) =="
URL2='https://repo.papermc.io/service/rest/v1/search?repository=maven-public&group=io.papermc.paper&name=paper-api&maven.baseVersion=1.21.11'
curl -sS "$URL2" | head -c 500; echo
echo
echo "== PaperMC repo search: baseVersion=1.21.11-R0.1-SNAPSHOT (raw first 500 chars) =="
URL3='https://repo.papermc.io/service/rest/v1/search?repository=maven-public&group=io.papermc.paper&name=paper-api&maven.baseVersion=1.21.11-R0.1-SNAPSHOT'
curl -sS "$URL3" | head -c 500; echoRepository: BadgersMC/Nexus
Length of output: 176
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== nexus-worldedit/build.gradle.kts (with line numbers, first 60 lines) =="
awk '{printf "%d:%s\n", NR, $0}' nexus-worldedit/build.gradle.kts | sed -n '1,60p'
echo
echo "== PaperMC repo search: baseVersion=1.21.1 (raw first 500 chars) =="
URL='https://repo.papermc.io/service/rest/v1/search?repository=maven-public&group=io.papermc.paper&name=paper-api&maven.baseVersion=1.21.1'
curl -sS "$URL" | head -c 500; echo
echo
echo "== PaperMC repo search: baseVersion=1.21.11 (raw first 500 chars) =="
URL2='https://repo.papermc.io/service/rest/v1/search?repository=maven-public&group=io.papermc.paper&name=paper-api&maven.baseVersion=1.21.11'
curl -sS "$URL2" | head -c 500; echo
echo
echo "== PaperMC repo search: baseVersion=1.21.11-R0.1-SNAPSHOT (raw first 500 chars) =="
URL3='https://repo.papermc.io/service/rest/v1/search?repository=maven-public&group=io.papermc.paper&name=paper-api&maven.baseVersion=1.21.11-R0.1-SNAPSHOT'
curl -sS "$URL3" | head -c 500; echoRepository: BadgersMC/Nexus
Length of output: 1539
🌐 Web query:
PaperMC repo.papermc.io service rest v1 search repository=maven-public group=io.papermc.paper name=paper-api how to query versions parameters maven.baseVersion
💡 Result:
Use PaperMC’s downloads service API (not the Maven repo “search” endpoint) to query available project versions and build IDs. 1) List all supported Minecraft versions (“versions”) for a PaperMC project Call: https://papermc.io/api/v1/paper This returns JSON with a versions array (examples in docs include 1.13.2, 1.13.1, 1.13-pre7, etc.) [1]. 2) Get build IDs for a specific Minecraft version Call: https://papermc.io/api/v1/paper/{minecraftVersion} The docs state the project-version URL returns all build IDs targeting that Minecraft version, and that the “build ids” are integers in v1 [1]. Example form: https://papermc.io/api/v1/paper/1.13.2 3) Use “latest” to avoid choosing a version/build manually The docs say you can use the static keyword latest in place of a specific build to get the latest build for that specific release of Minecraft, e.g.: https://papermc.io/api/v1/paper/{minecraftVersion}/latest/download [1]. 4) Maven coordinates in your build (“maven.baseVersion”) For Maven/Gradle dependency notation, PaperMC’s docs show using the paper-api artifact with a version pattern such as: compileOnly("io.papermc.paper:paper-api:26.1.2.build.+") [2]. However, the docs do not define a parameter named “maven.baseVersion”, and the PaperMC downloads API provides Minecraft-version selection and build download URLs directly rather than a “maven.baseVersion” parameter [1]. So, if your goal is “how do I query versions parameters maven.baseVersion” for PaperMC, the supported approach is: - query available Minecraft versions via the REST endpoint /api/v1/paper [1] - query builds for one Minecraft version via /api/v1/paper/{version} [1] - then use the resulting build IDs/versions to construct the Maven dependency version string pattern you choose (PaperMC shows using a wildcard build selector like.build.+) [2]. If you tell me what build system/plugin you’re using that mentions “maven.baseVersion” (e.g., a specific Paper plugin toolchain or Gradle/Maven helper), I can map the API response fields to exactly what that parameter expects.
Citations:
- 1: https://paperdocs-rework.readthedocs.io/en/rework/site/api.html
- 2: https://docs.papermc.io/paper/dev/project-setup/
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== PaperMC API /api/v1/paper =="
curl -sS 'https://papermc.io/api/v1/paper' | head -c 500; echo
echo
echo "== PaperMC API /api/v1/paper/1.21.1 =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.1' | head -c 2000; echo
echo
echo "== PaperMC API /api/v1/paper/1.21.11 =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.11' | head -c 2000; echo
echo
echo "== PaperMC API /api/v1/paper/1.21.1/latest =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.1/latest' | head -c 2000; echoRepository: BadgersMC/Nexus
Length of output: 6300
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== /api/v1/paper (first 500 chars) =="
curl -sS 'https://papermc.io/api/v1/paper' | head -c 500; echo
echo
echo "== /api/v1/paper/1.21.1 (first 3000 chars) =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.1' | head -c 3000; echo
echo
echo "== /api/v1/paper/1.21.11 (first 3000 chars) =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.11' | head -c 3000; echo
echo
echo "== /api/v1/paper/1.21.1/latest (first 3000 chars) =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.1/latest' | head -c 3000; echoRepository: BadgersMC/Nexus
Length of output: 6327
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== /api/v1/paper (first 500 chars) =="
curl -sS 'https://papermc.io/api/v1/paper' | head -c 500; echo
echo
echo "== /api/v1/paper/1.21.1 (first 3000 chars) =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.1' | head -c 3000; echo
echo
echo "== /api/v1/paper/1.21.11 (first 3000 chars) =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.11' | head -c 3000; echo
echo
echo "== /api/v1/paper/1.21.1/latest (first 3000 chars) =="
curl -sS 'https://papermc.io/api/v1/paper/1.21.1/latest' | head -c 3000; echoRepository: BadgersMC/Nexus
Length of output: 6327
🏁 Script executed:
#!/bin/bash
set -euo pipefail
BASE='https://repo.papermc.io/repository/maven-public'
META="$BASE/io/papermc/paper/paper-api/maven-metadata.xml"
echo "== Fetch maven-metadata.xml for io.papermc.paper:paper-api =="
curl -sS "$META" | head -n 40
echo
echo "== Look for versions containing 1.21.11 or 1.21.1 =="
curl -sS "$META" | rg -n "1\.21\.(11|1)([^0-9]|$)" || true
echo
echo "== Exact match search for 1.21.11-R0.1-SNAPSHOT and 1.21.1-R0.1-SNAPSHOT =="
curl -sS "$META" | rg -n "1\.21\.11-R0\.1-SNAPSHOT|1\.21\.1-R0\.1-SNAPSHOT" || trueRepository: BadgersMC/Nexus
Length of output: 2512
nexus-worldedit/build.gradle.kts:18 — Paper API version mismatch (1.21.11 vs PR-stated 1.21.1); both exist, so no resolution failure but you’re targeting a different API snapshot. The Maven metadata for io.papermc.paper:paper-api contains both 1.21.1-R0.1-SNAPSHOT and 1.21.11-R0.1-SNAPSHOT, so 1.21.11-R0.1-SNAPSHOT won’t be missing—but it contradicts the PR objective. Fix by updating the dependency to 1.21.1-R0.1-SNAPSHOT or updating the PR objective to 1.21.11.
🧰 Tools
🪛 GitHub Check: Codacy Static Code Analysis
[warning] 18-18: nexus-worldedit/build.gradle.kts#L18
A gitleaks generic-api-key was detected which attempts to identify hard-coded credentials.
🤖 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 `@nexus-worldedit/build.gradle.kts` at line 18, The Paper API dependency in
build.gradle.kts is targeting the wrong snapshot version; change the compileOnly
dependency declaration that references io.papermc.paper:paper-api (the
compileOnly(...) line) to use 1.21.1-R0.1-SNAPSHOT if the PR intends to target
1.21.1, or alternatively update the PR description/objective to state 1.21.11 if
you intend to keep 1.21.11-R0.1-SNAPSHOT so the declared version and PR
objective match.
- Remove unused imports (BlockVector3, Plugin, Logger) from WorldEditAdapter - Remove unused log field from WorldEditAdapter - Add KDoc to isFawePresent explaining it is a public API for consumers - Check mkdirs() return value and fail fast with a clear message - Add KDoc to SchematicService explaining regionId resolution contract (WG RegionContainer) - Keep paper-api at 1.21.11-R0.1-SNAPSHOT (correct server target; CR comment was wrong)
- Root build.gradle.kts: detekt 1.23.8 via subprojects block - config/detekt/detekt.yml: shared rule config, thresholds tuned for plugin code - publish.yml: add ci job with detekt + semgrep + trivy; publish needs ci
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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/publish.yml:
- Around line 3-10: Add a concurrency block to the workflow to cancel superseded
branch/PR runs: insert a concurrency mapping with group set to the workflow+ref
(e.g., group: ${{ github.workflow }}-${{ github.ref }}) and set
cancel-in-progress to only true for pull_request events (e.g.,
cancel-in-progress: ${{ github.event_name == 'pull_request' }}), ensuring tag
refs (publish runs) are not canceled; place this block at the top-level of the
publish.yml workflow alongside the existing on: section.
- Around line 12-14: The workflow currently grants packages: write at the
top-level permissions which gives all jobs (including ci) unnecessary write
access; modify .github/workflows/publish.yml to keep permissions: contents: read
at the top level and remove packages: write there, then add a permissions block
inside the publish job (the job named "publish") that includes packages: write
(and contents: read if needed) so only the publish job has write access to
GitHub Packages.
- Around line 45-55: Replace the mutable Trivy action reference and fix the
gating flags: change uses: aquasecurity/trivy-action@master to a pinned release
tag or commit SHA (pin to a specific version) and decide whether this scan
should block publishing — if it should enforce failures remove
continue-on-error: true and keep exit-code: '1'; if it should be advisory, keep
continue-on-error: true and remove exit-code: '1'. Ensure you update the Trivy
step that contains scan-type, scan-ref, format, exit-code, severity,
ignore-unfixed to reflect this choice.
- Around line 19-21: The CI job's if condition excludes tag pushes so when a
v*.*.* tag is pushed the ci job is skipped and publish (which has needs: ci) is
also skipped; update the ci job's if expression (the existing "if:
(github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) ||
github.event_name == 'pull_request'") to include tag pushes (for example change
to "if: github.event_name == 'push' || github.event_name == 'pull_request'") so
ci runs on tag pushes too, or alternatively add an explicit branch to allow
refs/tags/* (e.g. include startsWith(github.ref, 'refs/tags/')) so the ci job
runs and publish.needs: ci will be satisfied.
In `@build.gradle.kts`:
- Around line 52-63: Remove the redundant wiring that manually makes the detekt
task depend on check (the tasks.matching { it.name == "detekt" } ... block)
because the detekt plugin already integrates with Gradle's check lifecycle; also
update the misleading comment at the top ("Apply detekt to every subproject that
has Kotlin source") to accurately reflect that you are applying the
"io.gitlab.arturbosch.detekt" plugin unconditionally (or change to only apply
conditionally if you prefer by checking for Kotlin sources/plugins), leaving the
DetektExtension configuration block (config.setFrom, buildUponDefaultConfig,
allRules) intact.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 9c8781ed-21a1-44c9-9461-78f8b4a774cc
📒 Files selected for processing (7)
.github/workflows/publish.ymlbuild.gradle.ktsconfig/detekt/detekt.ymlnexus-worldedit/build.gradle.ktsnexus-worldedit/src/main/kotlin/net/badgersmc/nexus/worldedit/SchematicService.ktnexus-worldedit/src/main/kotlin/net/badgersmc/nexus/worldedit/WorldEditAdapter.ktsettings.gradle.kts
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: | ||
| - 'v*.*.*' # v1.11.0, v1.12.0-rc1, etc. | ||
| workflow_dispatch: # allow manual publishes from the Actions tab | ||
| - 'v*.*.*' | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
publish.yml:3-10 — no concurrency group; rapid PR pushes pile up redundant CI runs.
Add cancel-in-progress concurrency so superseded PR/branch runs are cancelled, saving runner minutes:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}Keep cancel-in-progress off for tag refs so a publish in flight isn't killed.
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 3-10: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 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/workflows/publish.yml around lines 3 - 10, Add a concurrency block
to the workflow to cancel superseded branch/PR runs: insert a concurrency
mapping with group set to the workflow+ref (e.g., group: ${{ github.workflow
}}-${{ github.ref }}) and set cancel-in-progress to only true for pull_request
events (e.g., cancel-in-progress: ${{ github.event_name == 'pull_request' }}),
ensuring tag refs (publish runs) are not canceled; place this block at the
top-level of the publish.yml workflow alongside the existing on: section.
| permissions: | ||
| contents: read | ||
| packages: write # required for maven.pkg.github.com push |
There was a problem hiding this comment.
publish.yml:12-14 — packages: write is workflow-wide; only publish needs it.
The ci job runs on every PR (including forks once enabled) and gets write access to GitHub Packages it never uses. Scope the token down: keep contents: read at the top, grant packages: write only on the publish job.
Proposed fix
permissions:
contents: read
- packages: write # required for maven.pkg.github.com push
jobs:
ci:
runs-on: ubuntu-latest
...
publish:
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write # required for maven.pkg.github.com push
if: startsWith(github.ref, 'refs/tags/v')
needs: ci📝 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.
| permissions: | |
| contents: read | |
| packages: write # required for maven.pkg.github.com push | |
| permissions: | |
| contents: read | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| ... | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write # required for maven.pkg.github.com push | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: ci |
🧰 Tools
🪛 zizmor (1.25.2)
[error] 14-14: overly broad permissions (excessive-permissions): packages: write is overly broad at the workflow level
(excessive-permissions)
🤖 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/workflows/publish.yml around lines 12 - 14, The workflow currently
grants packages: write at the top-level permissions which gives all jobs
(including ci) unnecessary write access; modify .github/workflows/publish.yml to
keep permissions: contents: read at the top level and remove packages: write
there, then add a permissions block inside the publish job (the job named
"publish") that includes packages: write (and contents: read if needed) so only
the publish job has write access to GitHub Packages.
| if: >- | ||
| (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) || | ||
| github.event_name == 'pull_request' |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In GitHub Actions, if a job is skipped due to its if condition, is a downstream job that uses needs on it also skipped by default?
💡 Result:
Yes, if a job is skipped, any downstream job that depends on it (via the needs keyword) is also skipped by default [1]. This occurs because GitHub Actions defaults to requiring successful completion of all jobs listed in the needs property [1]. When a prerequisite job is skipped or fails, the default behavior is to skip all dependent jobs in the dependency chain [1]. To override this default behavior and allow a dependent job to run even if a prerequisite job was skipped, you must include a conditional expression in the downstream job's if property [1]. A common approach is to use the always status check function, often combined with a check on the result of the required job, such as: if: ${{ always && (needs.job_name.result == 'success' || needs.job_name.result == 'skipped') }} By explicitly adding this condition, you instruct the GitHub Actions runner to evaluate the job's execution requirements differently than the default success-only criteria [1].
Citations:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE=".github/workflows/publish.yml"
if [ ! -f "$FILE" ]; then
echo "Missing $FILE"
exit 1
fi
nl -ba "$FILE" | sed -n '1,200p'Repository: BadgersMC/Nexus
Length of output: 102
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE=".github/workflows/publish.yml"
[ -f "$FILE" ] || { echo "Missing $FILE"; exit 1; }
cat -n "$FILE" | sed -n '1,160p'Repository: BadgersMC/Nexus
Length of output: 5109
.github/workflows/publish.yml:19-21 — Tag pushes skip ci, so publish (needs: ci) is skipped and nothing is published.
On v*.*.* tag pushes, ci’s if evaluates false (it excludes refs/tags/*), so ci is skipped; with publish.needs: ci, GitHub Actions skips publish by default even though publish.if is true.
Proposed fix
ci:
runs-on: ubuntu-latest
if: >-
- (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) ||
- github.event_name == 'pull_request'
+ github.event_name == 'push' ||
+ github.event_name == 'pull_request'📝 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: >- | |
| (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) || | |
| github.event_name == 'pull_request' | |
| ci: | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event_name == 'pull_request' |
🤖 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/workflows/publish.yml around lines 19 - 21, The CI job's if
condition excludes tag pushes so when a v*.*.* tag is pushed the ci job is
skipped and publish (which has needs: ci) is also skipped; update the ci job's
if expression (the existing "if: (github.event_name == 'push' &&
!startsWith(github.ref, 'refs/tags/')) || github.event_name == 'pull_request'")
to include tag pushes (for example change to "if: github.event_name == 'push' ||
github.event_name == 'pull_request'") so ci runs on tag pushes too, or
alternatively add an explicit branch to allow refs/tags/* (e.g. include
startsWith(github.ref, 'refs/tags/')) so the ci job runs and publish.needs: ci
will be satisfied.
- pin aquasecurity/trivy-action to 0.28.0 (was @master, mutable) - resolve Trivy gating contradiction: drop exit-code so it is advisory-only, consistent with Semgrep - remove redundant detekt->check wiring (plugin wires it by default) and fix the misleading subproject comment Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PR BadgersMC#10 introduced detekt to CI, which surfaced 22 latent violations in modules unrelated to the worldedit work. Fix them so the CI detekt gate passes (behavior preserved; all module tests green): - nexus-core: drop redundant printStackTrace calls (ConfigManager), remove unused logger (NexusContext), extract value conversion out of loadFromMap to cut cyclomatic complexity (ConfigLoader) - nexus-i18n: rename StubJavaPlugin.kt -> TestLangHost.kt to match the declared class (MatchingDeclarationName) - nexus-paper: suppress fixture-only warnings on TestCommand; extract buildParameter from processClass to satisfy ThrowsCount - nexus-permissions: replace jump-heavy loop with firstOrNull - nexus-persistence: split discover() into scanJars/scanExplodedDirs and move SQL splitting into a StatementSplitter state machine - nexus-resources: convert jar/exploded-dir extraction loops to sequence pipelines Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The previous pin @0.28.0 failed to resolve — aquasecurity/trivy-action tags carry a leading v. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Add
nexus-worldedit-- a new Nexus module that wraps WorldEdit and FastAsyncWorldEdit behind a single facade API.What's in this module
SchematicService(interface)capture(regionId, world, outputFile): Result-- copy a region to a schematic filerestore(regionId, world, sourceFile, async): Result-- paste a schematic back to a region (async by default)Resulttype:Success/Failure(cause)WorldEditAdapter(object)saveSchematic(clipboard, file)-- writes any WE clipboard to.schemloadSchematic(file)-- reads.schemback into a WE clipboardcompileOnlydeps -- zero transitive jar bloatDependencies
worldedit-bukkitFastAsyncWorldEdit-Bukkitpaper-apiWhy this module
nexus-worldedit, never on WE/FAWE directlycompileOnlykeeps shadow jars cleanFeatures