Skip to content

Migrate Core and Manager Scripts. Align CI pipeline and tests with new script layout, add GUT.#576

Merged
ikostan merged 21 commits intomainfrom
create-new-script-directory-skeleton
Apr 21, 2026
Merged

Migrate Core and Manager Scripts. Align CI pipeline and tests with new script layout, add GUT.#576
ikostan merged 21 commits intomainfrom
create-new-script-directory-skeleton

Conversation

@ikostan
Copy link
Copy Markdown
Owner

@ikostan ikostan commented Apr 19, 2026


This summary outlines the architectural improvements, pipeline enhancements, and environment optimizations implemented for SkyLockAssault in this PR.

Summary of Changes

1. Directory Reorganization

  • Refactored the scripts/ directory from a flat structure into a modular, feature-oriented hierarchy.
  • Organized scripts into functional subdirectories: core/, entities/, managers/, resources/, system/, and ui/.
  • Relocated core project resources, including game_settings_resource.gd and audio_constants.gd, into the res://scripts/resources/ folder for improved asset management.

2. Pipeline Infrastructure Updates

  • GUT Integration: Added a dedicated step to run_pipeline.sh to execute GUT unit tests alongside existing GDUnit4 tests.
  • Test Isolation: Configured test discovery to point strictly to res://test/gut/ via .gutconfig.json, preventing GUT from scanning and conflicting with GDUnit4 test suites.
  • Reporting & Stability: Restored and enhanced the report summary block in the pipeline script to provide clear metrics on total tests, passes, and failures.
  • Failure Guard: Implemented an explicit failure check that terminates the pipeline with a critical error message if report.xml is not generated.

3. Docker & Environment Optimization

  • Dependency Baking: Updated the Dockerfile to pre-install GUT v9.5.0, eliminating the need for on-demand downloads during CI/CD runs.
  • Linter Version Pinning: Globally installed markdownlint-cli2@0.12.1 within the image to ensure compatibility with Node.js v18 and prevent breaking changes from upstream updates.
  • Performance: Removed network-dependent installation logic from run_pipeline.sh, resulting in faster and more resilient build cycles.

4. Bug Fixes & Refinement

  • Timeout Synchronization: Corrected a unit mismatch by updating PW_TIMEOUT to seconds (10s) to align with pytest-timeout expectations.
  • Linting Scope: Adjusted the Markdown linter to explicitly exclude the venv/ directory, preventing false positives from third-party library documentation.
  • Path Management: Updated all internal pipeline paths to reflect the new scripts/ subfolder structure.

name: Default Pull Request Template
about: Suggesting changes to SkyLockAssault
title: ''
labels: ''
assignees: ''

Description

What does this PR do? (e.g., "Fixes player jump physics in level 2" or "Adds
new enemy AI script")

Related Issue

Closes #ISSUE_NUMBER (if applicable)

Changes

  • List key changes here (e.g., "Updated Jump.gd to use Godot 4.4's new Tween
    system")
  • Any breaking changes? (e.g., "Deprecated old signal; migrate to new one")

Testing

  • Ran the game in Godot v4.5 editor—describe what you tested (e.g., "Jump
    works on Win10 with 60 FPS")
  • Any new unit tests added? (Link to test scene if yes)
  • Screenshots/GIFs if UI-related: (Attach below)

Checklist

  • Code follows Godot style guide (e.g., snake_case for variables)
  • No console errors in editor/output
  • Ready for review!

Additional Notes

Anything else? (e.g., "Tested on Win10 64-bit; needs Linux validation")


Based on the technical changes and commit history within the project, here is a summary of the contributions made by @ikostan to this PR:

Core Pipeline Infrastructure

  • [cite_start]CI/CD Integration: Engineered the logic to integrate GUT unit tests into the main run_pipeline.sh script, ensuring multiple testing frameworks (GDUnit4 and GUT) execute sequentially[cite: 1036].
  • [cite_start]Environment Optimization: Refactored the Dockerfile and pipeline script to bake stable dependencies like GUT and specific versions of markdownlint-cli2 directly into the image to eliminate network dependencies and improve build speeds[cite: 1032, 1036].
  • [cite_start]Error Handling & Reporting: Implemented a critical failure check for report.xml generation and mapped internal variables to pytest-timeout parameters to prevent silent pipeline hangs[cite: 1036].

Project Reorganization

  • [cite_start]Directory Refactoring: Initiated the transition of the scripts/ directory to a feature-oriented structure, specifically moving files into dedicated ui/, core/, managers/, entities/, and system/ subfolders for better modularity[cite: 263, 264, 265, 266].
  • [cite_start]Resource Standardization: Relocated core configuration scripts, such as game_settings_resource.gd and audio_constants.gd, into a centralized resources/ folder to ensure consistent pathing across the project[cite: 263].

Testing & Compliance

  • [cite_start]Test Isolation: Configured the pipeline to isolate test discovery by pointing GUT strictly to res://test/gut/, preventing conflicts with the GDUnit4 test suite[cite: 1036].
  • [cite_start]Linting & Standards: Adjusted the linting scope to exclude the venv/ directory, ensuring that static analysis focuses solely on project source code and adheres to the established Python and GDScript coding standards[cite: 1036].

This summary details the AI and automation bot contributions for the project's recent infrastructure and testing updates.

The following bots provided automated code reviews, refactoring suggestions, and static analysis to maintain code quality and security standards:

  • @deepsource-autofix[bot]: Performed static analysis to identify code quality issues and security vulnerabilities, providing automated fixes to align with the project's "Python Security" and "Python Code Quality" analyzers.
  • @coderabbitai: Provided contextual AI code reviews, offering line-by-line feedback on script changes and suggesting optimizations for the pipeline logic.
  • @sourcery-ai[bot]: Focused on refactoring Python code by suggesting more idiomatic patterns and improving the overall readability of the testing scripts.
  • @imgbot[bot]: Monitored the repository for new image assets (such as sprites and icons) and automatically applied lossless compression to optimize the project's footprint.
  • @all-contributors[bot]: Managed the recognition of these and other contributors within the repository's documentation.

AI and Bot Contributors:
@deepsource-autofix[bot], @coderabbitai, @sourcery-ai[bot], @imgbot[bot], @all-contributors[bot]


Summary by Sourcery

Update tooling, tests, and documentation to align with the new project structure and web deployment workflow.

Enhancements:

  • Update the pipeline script to use a pinned markdownlint npm invocation and streamline Godot export and Playwright test steps.
  • Adjust references to the globals script to reflect its new core script location.

Documentation:

  • Tidy formatting and list styles in the web deployment guide, README, and development guide to improve readability and consistency.

Tests:

  • Add execution of GUT-based unit tests to the pipeline and update a GDUnit4 test to load the globals script from its new path.

Summary by Sourcery

Align tooling, tests, and documentation with the updated Godot project structure and CI pipeline.

Enhancements:

  • Refine the pipeline script to pin markdownlint-cli2, exclude virtualenv files, improve GDUnit4 test execution, and harden web export and Playwright reporting logic.

Build:

  • Pin markdownlint-cli2 to a specific npm version in the Docker image to ensure consistent linting behavior across environments.

Documentation:

  • Tidy and normalize list formatting, headings, and wording in the web deployment guide, README, and development guide for better readability and consistency.

Tests:

  • Update GDUnit4 tests to load audio manager and globals from their new script paths under scripts/core and scripts/managers.
  • Extend the CI pipeline to install and execute GUT-based unit tests alongside existing GDUnit4 tests.

Summary by CodeRabbit

  • Chores

    • Reorganized internal script locations and updated project autoloads for cleaner structure.
    • Updated pipeline to improve linting, tighten test failure handling, and add an automated unit test stage.
    • Added developer files to ignore list to keep local scan outputs out of version control.
  • Documentation

    • Minor formatting and whitespace fixes across README and developer guides for improved readability.
  • Tests

    • Updated unit test setups to align with the reorganized scripts.

@ikostan ikostan self-assigned this Apr 19, 2026
@ikostan ikostan added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 19, 2026
@ikostan ikostan linked an issue Apr 19, 2026 that may be closed by this pull request
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 19, 2026

Reviewer's Guide

Reorganizes core Godot scripts into a new scripts/core and scripts/managers structure and updates tooling, tests, and docs to match, while tightening the CI pipeline for linting and automated unit/browser tests.

Flow diagram for new Godot scripts folder structure and references

flowchart LR
    project[Project_root]
    scripts_dir[scripts/]
    core_dir[core/\n- globals.gd\n- main_scene.gd\n- settings.gd]
    managers_dir[managers/\n- audio_manager.gd\n- resource_preloader.gd]

    project --> scripts_dir
    scripts_dir --> core_dir
    scripts_dir --> managers_dir

    project_godot[project.godot<br/>Autoloads]
    main_scene_tscn[scenes/main_scene.tscn]
    tests_gdunit4[test/gdunit4/*]

    project --> project_godot
    project --> main_scene_tscn
    project --> tests_gdunit4

    project_godot --> autoload_globals[Autoload_globals_from<br/>res://scripts/core/globals.gd]
    project_godot --> autoload_settings[Autoload_settings_from<br/>res://scripts/core/settings.gd]
    project_godot --> autoload_main_scene[Main_scene_reference_to<br/>res://scripts/core/main_scene.gd]

    main_scene_tscn --> main_scene_script_ref[Node_script_reference_to<br/>res://scripts/core/main_scene.gd]

    tests_gdunit4 --> test_globals_path[Update_paths_to<br/>res://scripts/core/globals.gd]
    tests_gdunit4 --> test_audio_manager_path[Update_paths_to<br/>res://scripts/managers/audio_manager.gd]
Loading

File-Level Changes

Change Details Files
Tighten and extend the CI pipeline script to use pinned tooling, add GUT tests, and make browser test failures more explicit.
  • Use pre-installed markdownlint-cli2 with an ignore pattern for venv and keep YAML lint step unchanged.
  • Require GDUnit4 addon to already exist and narrow its test path to the gdunit4 test directory.
  • Install and run GUT unit tests via the gut_cmdln.gd entry point governed by .gutconfig.json.
  • Export the Godot project for web, start a temporary HTTP server with readiness checks, and run Playwright tests with an explicit timeout passed from PW_TIMEOUT.
  • Fail the pipeline when Playwright report.xml is missing, and always clean up the web server and copy reports and artifacts to the project artifacts directory.
run_pipeline.sh
Pin markdownlint CLI version in the Docker image to ensure reproducible linting.
  • Install markdownlint-cli2 at version 0.12.1 instead of the latest version.
Dockerfile
Align GDUnit4 tests with the reorganized script locations.
  • Update audio manager test to load the audio_manager script from scripts/managers.
  • Update globals test to load the globals script from scripts/core.
test/gdunit4/test_audio_manager.gd
test/gdunit4/test_globals.gd
Tidy and clarify documentation formatting and list styles.
  • Normalize bullet/list usage and break out introductory bullets in the web deployment guide for clarity, including trimming an outdated reference to Game Jolt in a manual phase list.
  • Add spacing before certain lists and convert limitation bullets in the README to consistent markdown list syntax.
  • Clarify wording and switch to bullet-style description of the settings signal and parameters in the development guide, including fixing a trailing period in a heading.
files/docs/Platforms_for_Web_Deployment_Guide.md
README.md
files/docs/Development_Guide.md
Update project configuration, scenes, and ignore rules to reflect the new core/managers script layout and developer-local artifacts.
  • Adjust Godot project configuration and main scene to reference scripts in scripts/core and scripts/managers instead of the previous flat scripts directory.
  • Ignore new developer / local tooling output files or directories in version control.
  • Update main scene script references to use the new core and manager script paths.
project.godot
scenes/main_scene.tscn
.gitignore

Assessment against linked issues

Issue Objective Addressed Explanation
#526 Move high-level core scripts (globals.gd, main_scene.gd, settings.gd) from the root scripts folder into scripts/core/ and update all references.
#526 Move manager scripts (audio_manager.gd, resource_preloader.gd) from the root scripts folder into scripts/managers/ and update all references.
#526 Update project configuration (e.g., Autoloads in project.godot and scene references) so that the moved core and manager scripts are correctly referenced from their new locations.

Possibly linked issues

  • #[FEATURE] Refactor Phase 3: Migrate Core and Manager scripts: The PR performs the requested core/ and managers/ script migrations and updates references, matching the refactor issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

📝 Walkthrough

Walkthrough

Rewires script paths to res://scripts/core/ and res://scripts/managers/, updates scene and tests to new paths, adds CI pipeline changes (lint invocation, GUT test stage, Playwright failure handling), adjusts documentation formatting, and adds two files to .gitignore.

Changes

Cohort / File(s) Summary
Autoload / Script Path Updates
project.godot
Updated autoload entries to point to moved scripts under res://scripts/core/ and res://scripts/managers/ (Globals, Settings, AudioManager).
Scenes & Resource Wiring
scenes/main_scene.tscn
Updated ExtResource script references to new core/managers locations for main scene script and resource preloader.
Tests
test/gdunit4/test_globals.gd, test/gdunit4/test_audio_manager.gd
Adjusted test instantiation paths to new script locations under res://scripts/core/ and res://scripts/managers/.
CI / Pipeline Script
run_pipeline.sh
Replaced markdownlint call with pinned npx markdownlint-cli2@0.12.1 --yes, added explicit !venv/** exclusion, added GUT test download/run stage, tightened Playwright report handling to fail on missing report.xml, and other cleanup.
Documentation
README.md, files/docs/Development_Guide.md, files/docs/Platforms_for_Web_Deployment_Guide.md
Whitespace and list marker formatting changes, adjusted heading spacing and line-wrap artifacts without semantic changes.
VCS Ignore
.gitignore
Added scan_project.py and project_structure.txt to ignore list.
Project Structure Manifest
project_structure.txt (now ignored)
Newly added file (now excluded via .gitignore).

Sequence Diagram(s)

sequenceDiagram
    participant CI as rgba(30,144,255,0.5) CI Runner
    participant Repo as rgba(34,139,34,0.5) Repository
    participant Lint as rgba(255,165,0,0.5) markdownlint (npx)
    participant Gut as rgba(148,0,211,0.5) GUT (addons/gut)
    participant Godot as rgba(220,20,60,0.5) Godot Engine
    participant Playwright as rgba(0,128,128,0.5) Playwright tests
    participant Web as rgba(75,0,130,0.5) Web Server

    CI->>Repo: checkout
    CI->>Lint: run `npx markdownlint-cli2@0.12.1 --yes` (excl. venv)
    CI->>Gut: ensure `addons/gut` present (download if missing)
    CI->>Godot: run GUT tests (`res://addons/gut/gut_cmdln.gd`)
    CI->>Web: start web server for Playwright
    CI->>Playwright: run end-to-end tests, produce `report.xml`
    Playwright->>CI: if `report.xml` missing -> CI kills Web server and exits 1
    CI->>Repo: report status
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels

CI/CD, testing

Poem

🐰 I hopped through paths and tidy rows,
Moved scripts to cores where soft wind blows,
Tests now find their cozy nest,
Pipelines chew lint and run the rest,
A tiny rabbit cheers the code that grows.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is extensive and technically detailed, but deviates significantly from the provided template structure and includes extraneous content (bot attributions, multiple 'Summary by Sourcery' sections, citation markers). Reorganize the description to follow the template: use clear 'Description', 'Related Issue', 'Changes', 'Testing', 'Checklist', and 'Additional Notes' sections. Remove bot attribution paragraphs and duplicate summary sections. Clarify which changes are included in this PR versus documentation.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title accurately reflects the main change: migrating core and manager scripts, aligning CI pipeline and tests, and adding GUT support.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch create-new-script-directory-skeleton

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.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In run_pipeline.sh, removing the report.xml existence warning means a missing or failed pytest run will now fail silently; consider restoring a clear message or explicit failure if the report is absent to make pipeline debugging easier.
  • The npx --yes markdownlint-cli2@0.12.1 invocation couples the pipeline to an on-demand network install of a specific version on every run; consider using a locally installed tool (or caching) and/or moving the version pin to a central config so CI remains faster and less dependent on external availability.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `run_pipeline.sh`, removing the `report.xml` existence warning means a missing or failed pytest run will now fail silently; consider restoring a clear message or explicit failure if the report is absent to make pipeline debugging easier.
- The `npx --yes markdownlint-cli2@0.12.1` invocation couples the pipeline to an on-demand network install of a specific version on every run; consider using a locally installed tool (or caching) and/or moving the version pin to a central config so CI remains faster and less dependent on external availability.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Apr 19, 2026

DeepSource Code Review

We reviewed changes in 5c46405...0aa098b on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Python Apr 21, 2026 2:16a.m. Review ↗
JavaScript Apr 21, 2026 2:16a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@ikostan ikostan moved this to In Progress in Sky Lock Assault Project Apr 19, 2026
@ikostan ikostan changed the title Create new script directory skeleton Migrate Core and Manager Scripts Apr 19, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
files/docs/Platforms_for_Web_Deployment_Guide.md (2)

7-12: ⚠️ Potential issue | 🟡 Minor

Join the CI/CD phrase back into the sentence.

Line 12 now renders as a standalone + bullet, which breaks the paragraph flow.

📝 Proposed documentation fix
-We're building **SkyLockAssault** — a totally free-to-play browser
-game in **Godot v4.5** on **Windows 10 64-bit**. This is our learning
-journey into game dev, so we're keeping everything practical,
-low-friction, and focused on **automatic deploys** via GitHub Actions
-
-+ CI/CD where possible.
+We're building **SkyLockAssault** — a totally free-to-play browser
+game in **Godot v4.5** on **Windows 10 64-bit**. This is our learning
+journey into game dev, so we're keeping everything practical,
+low-friction, and focused on **automatic deploys** via GitHub Actions
++ CI/CD where possible.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@files/docs/Platforms_for_Web_Deployment_Guide.md` around lines 7 - 12, The
paragraph was split by a stray plus creating a standalone "+" bullet; merge the
line containing "CI/CD where possible." back into the previous sentence so the
paragraph reads smoothly (e.g., combine "focused on **automatic deploys** via
GitHub Actions" with "CI/CD where possible."), removing the extraneous "+" line;
edit the text around the project description in
Platforms_for_Web_Deployment_Guide.md to produce one continuous sentence
mentioning automatic deploys and CI/CD.

79-101: ⚠️ Potential issue | 🟡 Minor

Remove Game Jolt from the manual phase or reclassify it consistently.

The guide lists Game Jolt as 100% Auto on Line 79, but also includes it in the manual/occasional Phase 3 list on Line 101.

📝 Proposed consistency fix
-+ CrazyGames, Y8, GameDistribution, GamePix, Newgrounds, SoftGames, Game Jolt
++ CrazyGames, Y8, GameDistribution, GamePix, Newgrounds, SoftGames
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@files/docs/Platforms_for_Web_Deployment_Guide.md` around lines 79 - 101, The
document currently lists "Game Jolt" in both the "100% Auto: itch.io, Poki,
Viverse, Game Jolt" line and again under "Phase 3: Manual Once + Occasional" —
remove the duplicate by deleting "Game Jolt" from the Phase 3 bullet list (or
alternatively remove it from the 100% Auto line if you prefer it to be manual)
so that "100% Auto: ... Game Jolt" and "Phase 3: Manual Once + Occasional" are
consistent; update the Phase 3 list under the "Phase 3: Manual Once +
Occasional" heading to no longer include "Game Jolt."
files/docs/Development_Guide.md (1)

101-128: ⚠️ Potential issue | 🟡 Minor

Update the Core Files Reference paths for migrated singletons.

This section still points Globals and Settings to the old root script paths, while this PR updates the autoloads to res://scripts/core/....

📝 Proposed documentation fix
-| **Logic Observer**         | `res://scripts/globals.gd`                | Connects to the resource to trigger centralized logging and `_save_settings()`.   |
+| **Logic Observer**         | `res://scripts/core/globals.gd`           | Connects to the resource to trigger centralized logging and `_save_settings()`.   |
...
-| **Persistence Settings**   | `res://scripts/settings.gd`               | Manages low-level `InputMap` serialization and legacy migration logic.            |
+| **Persistence Settings**   | `res://scripts/core/settings.gd`          | Manages low-level `InputMap` serialization and legacy migration logic.            |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@files/docs/Development_Guide.md` around lines 101 - 128, Update the Core
Files Reference to use the migrated autoload paths: change the "Logic Observer"
entry for Globals to point to res://scripts/core/globals.gd and change the
"Persistence Settings" entry for Settings to res://scripts/core/settings.gd
(leave other file entries like game_settings_resource.gd, gameplay_settings.gd,
and advanced_settings.gd as-is); ensure the table rows referencing "Globals" and
"Settings" use these new res://scripts/core/... paths so the documentation
matches the autoload updates.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@run_pipeline.sh`:
- Around line 52-55: run_pipeline.sh currently runs GUT without installing it
and passes -gdir=res://test which ignores .gutconfig.json; update the GUT step
to first ensure GUT is installed (reuse the installation steps from
run_gut_unit_tests.sh or .github/workflows/gut_tests.yml to clone/install
addons/gut into the project) and change the godot invocation in the GUT Unit
Tests block to use -gdir=res://test/gut/ (or rely on
-gconfig=res://.gutconfig.json without overriding the configured dir) so only
the intended test directory is discovered.

---

Outside diff comments:
In `@files/docs/Development_Guide.md`:
- Around line 101-128: Update the Core Files Reference to use the migrated
autoload paths: change the "Logic Observer" entry for Globals to point to
res://scripts/core/globals.gd and change the "Persistence Settings" entry for
Settings to res://scripts/core/settings.gd (leave other file entries like
game_settings_resource.gd, gameplay_settings.gd, and advanced_settings.gd
as-is); ensure the table rows referencing "Globals" and "Settings" use these new
res://scripts/core/... paths so the documentation matches the autoload updates.

In `@files/docs/Platforms_for_Web_Deployment_Guide.md`:
- Around line 7-12: The paragraph was split by a stray plus creating a
standalone "+" bullet; merge the line containing "CI/CD where possible." back
into the previous sentence so the paragraph reads smoothly (e.g., combine
"focused on **automatic deploys** via GitHub Actions" with "CI/CD where
possible."), removing the extraneous "+" line; edit the text around the project
description in Platforms_for_Web_Deployment_Guide.md to produce one continuous
sentence mentioning automatic deploys and CI/CD.
- Around line 79-101: The document currently lists "Game Jolt" in both the "100%
Auto: itch.io, Poki, Viverse, Game Jolt" line and again under "Phase 3: Manual
Once + Occasional" — remove the duplicate by deleting "Game Jolt" from the Phase
3 bullet list (or alternatively remove it from the 100% Auto line if you prefer
it to be manual) so that "100% Auto: ... Game Jolt" and "Phase 3: Manual Once +
Occasional" are consistent; update the Phase 3 list under the "Phase 3: Manual
Once + Occasional" heading to no longer include "Game Jolt."
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d40a1533-310f-4e29-9067-d7783d5f7119

📥 Commits

Reviewing files that changed from the base of the PR and between 5c46405 and aff443f.

📒 Files selected for processing (15)
  • .gitignore
  • README.md
  • files/docs/Development_Guide.md
  • files/docs/Platforms_for_Web_Deployment_Guide.md
  • project.godot
  • run_gdunit4_unit_tests.sh
  • run_pipeline.sh
  • scenes/main_scene.tscn
  • scripts/core/globals.gd
  • scripts/core/globals.gd.uid
  • scripts/core/main_scene.gd
  • scripts/core/main_scene.gd.uid
  • scripts/core/settings.gd
  • scripts/core/settings.gd.uid
  • test/gdunit4/test_globals.gd
📜 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). (3)
  • GitHub Check: GUT Unit Tests / unit-test
  • GitHub Check: GDUnit4 Unit Tests / unit-test
  • GitHub Check: Sourcery review
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-04-10T00:07:55.427Z
Learnt from: ikostan
Repo: ikostan/SkyLockAssault PR: 534
File: scripts/player.gd:146-149
Timestamp: 2026-04-10T00:07:55.427Z
Learning: In `scripts/globals.gd` and `scripts/player.gd` (GDScript, Godot 4), `current_fuel` is intentionally treated as volatile session data and should NOT be saved to or loaded from `settings.cfg`. Only `max_fuel` (tank capacity) is a persistent setting. `current_fuel` is always reset to `max_fuel` unconditionally in `player._ready()`. Persisting `current_fuel` is considered an architectural mistake by the project maintainer (ikostan). Mid-run fuel state persistence is planned via a separate `SaveGameResource` in PR `#535`.

Applied to files:

  • test/gdunit4/test_globals.gd
  • files/docs/Development_Guide.md
🪛 Shellcheck (0.11.0)
run_pipeline.sh

[warning] 9-9: PW_TIMEOUT appears unused. Verify use (or export if used externally).

(SC2034)

🔇 Additional comments (5)
.gitignore (1)

50-51: LGTM — generated project-scan artifacts are ignored.

These entries fit the existing pattern of excluding local/generated tooling outputs from version control.

scenes/main_scene.tscn (1)

3-3: LGTM — scene script path matches the new core location.

The ExtResource id is preserved, and the supplied scripts/core/main_scene.gd context confirms the target script exists.

project.godot (1)

27-28: LGTM — autoload paths are consistent with the core script migration.

Both migrated singleton paths are backed by the supplied scripts/core/globals.gd and scripts/core/settings.gd snippets.

test/gdunit4/test_globals.gd (1)

16-16: LGTM — the test now targets the migrated Globals script.

This keeps the GDUnit4 coverage aligned with the new autoload path in project.godot.

README.md (1)

126-128: LGTM — Markdown spacing and bullet cleanup look correct.

The heading spacing and Known Limitations bullets now render cleanly.

Also applies to: 256-290

Comment thread run_pipeline.sh
ikostan added 6 commits April 18, 2026 21:52
The command assumes addons/gut/ already exists, but run_pipeline.sh does not install it. The existing run_gut_unit_tests.sh and .github/workflows/gut_tests.yml both include GUT installation logic that run_pipeline.sh lacks. Additionally, passing -gdir=res://test broadens test discovery beyond .gutconfig.json's configured res://test/gut/, so GUT may attempt to load unintended test suites (e.g., GDUnit4 tests under res://test/gdunit4/).
Move to managers/: audio_manager.gd, resource_preloader.gd.
RUN is a Dockerfile instruction and is not valid bash. Running this will cause a command not found error. It should be replaced with a conditional install bloc
This overrides the directory configured in .gutconfig.json (which points to res://test/gut/) and causes GUT to scan all subdirectories under res://test/, including GDUnit4 tests. These flags should be removed so -gconfig alone governs test discovery:
In run_pipeline.sh, removing the report.xml existence warning means a missing or failed pytest run will now fail silently; consider restoring a clear message or explicit failure if the report is absent to make pipeline debugging easier.
@ikostan
Copy link
Copy Markdown
Owner Author

ikostan commented Apr 21, 2026

  • In run_pipeline.sh, removing the report.xml existence warning means a missing or failed pytest run will now fail silently; consider restoring a clear message or explicit failure if the report is absent to make pipeline debugging easier.

Fixed

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
run_pipeline.sh (1)

9-9: Remove or wire PW_TIMEOUT into the pytest command. Line 9 defines PW_TIMEOUT=10000, but the pytest command on line 96 doesn't use the --timeout parameter, so the variable has no effect. Either add --timeout=$PW_TIMEOUT to the pytest invocation or remove the unused variable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@run_pipeline.sh` at line 9, The PW_TIMEOUT environment variable is set but
not used; either remove the PW_TIMEOUT=10000 assignment or wire it into the
pytest invocation by adding the pytest timeout flag. Locate the PW_TIMEOUT
assignment and the pytest command (the script's pytest invocation) and either
delete the PW_TIMEOUT line or modify the pytest command to include
--timeout=$PW_TIMEOUT (or the appropriate flag your test runner expects) so the
variable is actually applied.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@run_pipeline.sh`:
- Around line 40-41: Replace the silent copy of GDUnit4 (the line containing "cp
-r /project/addons/gdUnit4 $PROJECT_DIR/addons/ || true") with an explicit
existence check and fail/install behavior: test for the source directory
(/project/addons/gdUnit4) using [ -d ... ] or similar, and if missing either
exit with a non‑zero error and a clear message or fetch/install GDUnit4 from the
canonical source before copying; ensure the copy command runs only after the
check succeeds and remove the "|| true" so failures are not suppressed.
- Around line 81-89: The readiness check uses the loop index $i as a success
flag which causes a false failure when curl succeeds on the final iteration;
change the logic to track readiness explicitly by introducing a flag (e.g.,
READY=0) before the for-loop, set READY=1 immediately after a successful curl
(inside the if that echoes "Web server ready" and breaks), and after the loop
test READY (e.g., if [ "$READY" -ne 1 ] ...) to decide startup failure;
reference the loop variable i, the curl call, and SERVER_PORT when locating and
updating the code.

---

Nitpick comments:
In `@run_pipeline.sh`:
- Line 9: The PW_TIMEOUT environment variable is set but not used; either remove
the PW_TIMEOUT=10000 assignment or wire it into the pytest invocation by adding
the pytest timeout flag. Locate the PW_TIMEOUT assignment and the pytest command
(the script's pytest invocation) and either delete the PW_TIMEOUT line or modify
the pytest command to include --timeout=$PW_TIMEOUT (or the appropriate flag
your test runner expects) so the variable is actually applied.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7bd8f29f-de21-49e8-80cb-b2e0d90e2de1

📥 Commits

Reviewing files that changed from the base of the PR and between aff443f and bb19177.

📒 Files selected for processing (8)
  • project.godot
  • run_pipeline.sh
  • scenes/main_scene.tscn
  • scripts/managers/audio_manager.gd
  • scripts/managers/audio_manager.gd.uid
  • scripts/managers/resource_preloader.gd
  • scripts/managers/resource_preloader.gd.uid
  • test/gdunit4/test_audio_manager.gd
🚧 Files skipped from review as they are similar to previous changes (1)
  • project.godot
📜 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). (1)
  • GitHub Check: GUT Unit Tests / unit-test
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-03-30T04:02:28.002Z
Learnt from: ikostan
Repo: ikostan/SkyLockAssault PR: 500
File: test/gut/test_audio_web_bridge.gd:131-145
Timestamp: 2026-03-30T04:02:28.002Z
Learning: In GUT (Godot Unit Test) for Godot 4, when using `assert_called` / `assert_called_count` with parameter matching, you MUST include all parameters the method takes, even default ones. GUT cannot fill in default values automatically. For example, if `JavaScriptBridgeWrapper.eval(script: String, global_exec: bool = false)` is called as `eval(js_string)`, GUT records it as `eval(js_string, false)`, so the test assertion must be `.bind(js_string, false)` not just `.bind(js_string)`. This applies to project `SkyLockAssault` (ikostan/SkyLockAssault) in `test/gut/test_audio_web_bridge.gd`.

Applied to files:

  • run_pipeline.sh
🪛 Shellcheck (0.11.0)
run_pipeline.sh

[warning] 9-9: PW_TIMEOUT appears unused. Verify use (or export if used externally).

(SC2034)


[info] 89-89: Double quote to prevent globbing and word splitting.

(SC2086)

🔇 Additional comments (5)
scenes/main_scene.tscn (1)

3-8: LGTM — scene script references were updated consistently.

The Node2D and ResourcePreloader script paths now point to the new scripts/core/ and scripts/managers/ locations, and the attached script base types remain compatible with the scene nodes.

run_pipeline.sh (3)

51-67: LGTM — GUT installation and discovery are scoped correctly now.

The install block uses normal bash, and the test run relies on .gutconfig.json instead of broad -gdir overrides.


99-117: LGTM — missing Playwright report is now treated as fatal.

The new branch avoids silently completing without report.xml and cleans up the web server before exiting.


30-31: Consider the context: run_pipeline.sh is a local development tool, not a CI/CD gate.

Line 31 includes --fix, which allows the script to mutate files locally. While auto-fixing can be useful for local development (enabling developers to quickly fix linting issues), the concern about uncommitted changes being silently modified is valid only if this script is used in a CI/CD pipeline context.

However, run_pipeline.sh is not invoked by the CI/CD pipeline. The actual CI lint gate (.github/workflows/lint_readme.yml) uses the GitHub Action DavidAnson/markdownlint-cli2-action with fix: true, which does present the risk you described—allowing CI to pass with auto-fixed files that were never committed.

If the concern is about preventing auto-fixing at the CI gate, focus on the workflow file instead. If run_pipeline.sh is intended as a local-only development tool, the --fix flag is appropriate for convenience.

test/gdunit4/test_audio_manager.gd (1)

19-20: LGTM — the test now instantiates the relocated manager script.

The updated path matches the new scripts/managers/ location, and the methods used by the test remain present on audio_manager.gd.

Comment thread run_pipeline.sh Outdated
Comment thread run_pipeline.sh Outdated
… the environment

The npx --yes markdownlint-cli2@0.12.1 invocation couples the pipeline to an on-demand network install of a specific version on every run; consider using a locally installed tool (or caching) and/or moving the version pin to a central config so CI remains faster and less dependent on external availability.
@ikostan
Copy link
Copy Markdown
Owner Author

ikostan commented Apr 21, 2026

  • The npx --yes markdownlint-cli2@0.12.1 invocation couples the pipeline to an on-demand network install of a specific version on every run; consider using a locally installed tool (or caching) and/or moving the version pin to a central config so CI remains faster and less dependent on external availability.

Fixed

ikostan and others added 5 commits April 20, 2026 18:45
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
9-9: Remove or wire PW_TIMEOUT into the pytest command. Line 9 defines PW_TIMEOUT=10000, but the pytest command on line 96 doesn't use the --timeout parameter, so the variable has no effect. Either add --timeout=$PW_TIMEOUT to the pytest invocation or remove the unused variable.
Line 12 now renders as a standalone + bullet, which breaks the paragraph flow.
Remove Game Jolt from the manual phase or reclassify it consistently.

The guide lists Game Jolt as 100% Auto on Line 79, but also includes it in the manual/occasional Phase 3 list on Line 101.
@ikostan
Copy link
Copy Markdown
Owner Author

ikostan commented Apr 21, 2026

@sourcery-ai review

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • In run_pipeline.sh, consider avoiding downloading the GUT addon at runtime (wget/unzip from GitHub) as part of the CI pipeline, since this adds an external network dependency and potential flakiness—prefer checking it into the repo, using a submodule, or baking it into the Docker image instead.
  • The hard-coded GUT version URL (v9.5.0.zip) and extracted directory name in run_pipeline.sh tightly couple the pipeline to a specific release structure; consider centralizing this version in a variable or using a more robust path check so future version bumps are less error-prone.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `run_pipeline.sh`, consider avoiding downloading the GUT addon at runtime (wget/unzip from GitHub) as part of the CI pipeline, since this adds an external network dependency and potential flakiness—prefer checking it into the repo, using a submodule, or baking it into the Docker image instead.
- The hard-coded GUT version URL (`v9.5.0.zip`) and extracted directory name in `run_pipeline.sh` tightly couple the pipeline to a specific release structure; consider centralizing this version in a variable or using a more robust path check so future version bumps are less error-prone.

## Individual Comments

### Comment 1
<location path="run_pipeline.sh" line_range="9" />
<code_context>
 EXPORT_DIR="$PROJECT_DIR/export/web_thread_off"
 SERVER_PORT=8080
-PW_TIMEOUT=10000  # Default timeout in ms; adjustable
+PW_TIMEOUT=10000

 # Function to check if a step failed
</code_context>
<issue_to_address>
**issue (bug_risk):** Clarify timeout units to match pytest-timeout expectations

This value is now passed directly to `pytest` via `--timeout=$PW_TIMEOUT`, and `pytest-timeout` interprets it as seconds, not milliseconds. As written, `10000` is ~2.8 hours, not 10 seconds. Please either change the value to the intended number of seconds or clearly document that this timeout is in seconds to avoid accidental misconfiguration.
</issue_to_address>

### Comment 2
<location path="run_pipeline.sh" line_range="55-61" />
<code_context>

-# Upload reports (simulate artifact upload by copying to a reports dir)
+# 5. GUT Unit Tests
+echo "Ensuring GUT is installed in addons/..."
+if [ ! -d "$PROJECT_DIR/addons/gut" ]; then
+  mkdir -p "$PROJECT_DIR/addons"
+  wget https://github.com/bitwes/Gut/archive/refs/tags/v9.5.0.zip
+  unzip v9.5.0.zip -d "$PROJECT_DIR/addons"
+  mv "$PROJECT_DIR/addons/Gut-9.5.0/addons/gut" "$PROJECT_DIR/addons/gut"
+  rm -rf "$PROJECT_DIR/addons/Gut-9.5.0" v9.5.0.zip
+fi
+
</code_context>
<issue_to_address>
**suggestion (performance):** Avoid downloading and unpacking GUT on every pipeline run for performance and reliability

This step makes every CI run download and unzip GUT, adding avoidable network and I/O overhead and introducing a runtime dependency on GitHub being available. If GUT is a stable dependency, consider installing it in the Docker image (or caching it via a shared volume) so the pipeline avoids repeated downloads and file moves.

Suggested implementation:

```
# 5. GUT Unit Tests
# Assumes GUT is already installed in the Docker image at "$PROJECT_DIR/addons/gut"
if [ ! -d "$PROJECT_DIR/addons/gut" ]; then
  echo "GUT not found at '$PROJECT_DIR/addons/gut'."
  echo "Please ensure GUT is installed in the Docker image (or cached volume) before running this pipeline."
  exit 1
fi


```

To fully implement the suggestion:
1. Update your Dockerfile (or base image build) to clone/unpack GUT into `$PROJECT_DIR/addons/gut` at image build time, so it is available for the pipeline without network access.
2. If you are using a cache/volume approach instead, ensure that the cache populates `$PROJECT_DIR/addons/gut` before `run_pipeline.sh` executes.
3. If there is (or will be) a command that actually runs the GUT tests (e.g. `godot --headless ...`), place it immediately after this existence check and wrap it with `check_exit` as done for the other steps.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread run_pipeline.sh Outdated
Comment thread run_pipeline.sh Outdated
@ikostan
Copy link
Copy Markdown
Owner Author

ikostan commented Apr 21, 2026

@sourcery-ai title

@sourcery-ai sourcery-ai Bot changed the title Migrate Core and Manager Scripts Align CI pipeline and tests with new script layout, add GUT Apr 21, 2026
…tations

issue (bug_risk): Clarify timeout units to match pytest-timeout expectations

This value is now passed directly to pytest via --timeout=$PW_TIMEOUT, and pytest-timeout interprets it as seconds, not milliseconds. As written, 10000 is ~2.8 hours, not 10 seconds. Please either change the value to the intended number of seconds or clearly document that this timeout is in seconds to avoid accidental misconfiguration.
@ikostan ikostan changed the title Align CI pipeline and tests with new script layout, add GUT Migrate Core and Manager Scripts. Align CI pipeline and tests with new script layout, add GUT. Apr 21, 2026
…y pipeline run for performance and reliability

This step makes every CI run download and unzip GUT, adding avoidable network and I/O overhead and introducing a runtime dependency on GitHub being available. If GUT is a stable dependency, consider installing it in the Docker image (or caching it via a shared volume) so the pipeline avoids repeated downloads and file moves.

To fully implement the suggestion:

Update your Dockerfile (or base image build) to clone/unpack GUT into $PROJECT_DIR/addons/gut at image build time, so it is available for the pipeline without network access.
If you are using a cache/volume approach instead, ensure that the cache populates $PROJECT_DIR/addons/gut before run_pipeline.sh executes.
If there is (or will be) a command that actually runs the GUT tests (e.g. godot --headless ...), place it immediately after this existence check and wrap it with check_exit as done for the other steps.
@ikostan
Copy link
Copy Markdown
Owner Author

ikostan commented Apr 21, 2026

  • In run_pipeline.sh, consider avoiding downloading the GUT addon at runtime (wget/unzip from GitHub) as part of the CI pipeline, since this adds an external network dependency and potential flakiness—prefer checking it into the repo, using a submodule, or baking it into the Docker image instead.
  • The hard-coded GUT version URL (v9.5.0.zip) and extracted directory name in run_pipeline.sh tightly couple the pipeline to a specific release structure; consider centralizing this version in a variable or using a more robust path check so future version bumps are less error-prone.

All addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request refactoring

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Refactor Phase 3: Migrate Core and Manager scripts

1 participant