Skip to content

Sort imports in the nation AI tests so the format check passes - #6092

Closed
iiamlewis wants to merge 1 commit into
mainfrom
fix/format-nation-ai-tests
Closed

iiamlewis wants to merge 1 commit into
mainfrom
fix/format-nation-ai-tests

Conversation

@iiamlewis

Copy link
Copy Markdown
Contributor

What was wrong

main has been red since #5967 (the nation AI split). It landed with imports in ten test files in an order that oxfmt 0.48.0 (the version in package-lock.json, the one CI runs) doesn't accept. Two CI jobs fail on it:

  • 🎨 Prettier (npm run format:check) lists the ten files.
  • 🗺️ Generated maps up to date runs gen-maps, which formats the repo and then fails because git status isn't clean. It shows the same ten test files and no map files.

Every open PR fails both jobs too, because CI tests each PR merged into main. #6091 is one example.

What this changes

oxfmt 0.48.0 run on just those ten files. The only change is import order: execution/nation/* now sorts before execution/PlayerExecution, because the sort ignores case. Nothing else in the files changes.

Screenshots

None, because this only changes formatting in test files.

Checked

  • npx oxfmt@0.48.0 --check on this branch reports "All matched files use the correct format" across 1914 files. On main it fails on exactly these ten.
  • Watch out: newer oxfmt versions (0.73 is installed globally on some machines) may order these imports differently. Use the lockfile version, npm run format, not a global npx oxfmt.

🤖 Generated with Claude Code

#5967 landed with imports in ten test files out of the order oxfmt
0.48 (the lockfile version) expects, which fails the format check and
the generated-maps check on main and on every PR merged against it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 092de800-defb-4c05-bc28-c040133e45cb
📥 Commits

Reviewing files that changed from the base of the PR and between ad40ac6 and 9b3184a.

📒 Files selected for processing: 10
  • tests/AiAttackBehaviorNukedTerritory.test.ts
  • tests/BotAnnexation.test.ts
  • tests/NationBeachhead.test.ts
  • tests/NationBoatRouteSafety.test.ts
  • tests/NationCrownNukes.test.ts
  • tests/NationNukeSamOverwhelm.test.ts
  • tests/NationNukeStrikes.test.ts
  • tests/NationNukeTargeting.test.ts
  • tests/NationOverseasTargets.test.ts
  • tests/NationRunawayLeader.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

Walkthrough

The pull request reorders imports in ten test files. It does not change test logic or runtime behavior.

Changes

Test import ordering

Layer / File(s) Summary
Reorder test imports
tests/*
Imports for nation behaviors and executions were reordered across ten test files. Test logic remains unchanged.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Possibly related issues

Possibly related PRs

Suggested reviewers: evanpelle

Merge Risk: ⚪ Minimal · up to 9b318

The PR is limited to formatting-compatible import ordering, with no evidenced behavior or deployment risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the import-order changes in the nation AI tests and their formatting purpose.
Description check Passed The description is directly related to the changeset. It explains the formatting failures, the ten affected test files, the import-order change, and the validation performed.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 10 files.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

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

Imports line up, neat and clear
Tests keep doing what they did
No behavior takes a turn
Ten files sort their rows anew
Formatter order now shines through

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

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Verdict: Looks good. No issues found (0 critical, 0 major, 0 minor).

Checked for bugs and CLAUDE.md compliance. The diff only reorders import statements in 10 test files. Every removed import line comes back unchanged elsewhere in the same file, so nothing is added, dropped or changed. The new order (execution/nation/* before the execution/P…/S…/T…/U… modules) is the case-insensitive sort the PR description describes.

@VariableVince

Copy link
Copy Markdown
Contributor

@iiamlewis this is no longer needed now that the stack of #6074 has landed. I merged main into #6091 that you mentioned and CI is green now

@github-project-automation github-project-automation Bot moved this from Triage to Complete in OpenFront Release Management Oct 23, 2026
@iiamlewis

Copy link
Copy Markdown
Contributor Author

Ok great thank you

This branch was successfully deployed

1 active deployment
staging — 9b3184a8 Deployed Oct 23, 2026 by openfrontio[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants