Skip to content

New Task type ‘Set'#17

Merged
8bitAlex merged 7 commits intomainfrom
Set-Task-Type
Mar 18, 2026
Merged

New Task type ‘Set'#17
8bitAlex merged 7 commits intomainfrom
Set-Task-Type

Conversation

@8bitAlex
Copy link
Copy Markdown
Owner

This pull request introduces a new Set task type to the raid task system, allowing users to set and persist environment variables directly within their task configurations. The implementation includes updates to documentation, schema definitions, and the Go codebase to support variable storage, expansion, and loading. These changes make it easier to manage and reuse environment variables across tasks and runs.

New Task Type and Variable Management:

  • Added support for a Set task type, which sets an environment variable to a specified value (supporting variable expansion), persists it across runs, and gives it precedence over .env files and OS environment variables (README.md, schemas/raid-defs.schema.json, profile.raid.yml). [1] [2] [3] [4]

Schema and Embedded Filesystem Updates:

  • Updated the JSON schema (raid-defs.schema.json) to define the Set task type, and refactored schema embedding to use Go's embed package with a new schemas.FS for easier schema loading (schemas/fs.go, src/internal/lib/lib.go). [1] [2] [3] [4]
  • Removed old schema files (raid-defs.schema.json, raid-profile.schema.json) as part of the migration to the new embedded schema system. [1] [2]

Go Codebase Enhancements:

  • Implemented a new variable store in Go, including functions to load, set, and expand raid variables, ensuring they take precedence and persist across runs (src/internal/lib/lib.go). [1] [2]
  • Ensured that raid variables are loaded and reset appropriately when the profile is (re)loaded, preventing stale values between runs (src/internal/lib/lib.go).

These changes collectively improve the flexibility and robustness of environment variable management in raid task workflows.

Copilot AI review requested due to automatic review settings March 18, 2026 01:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new Set task type to Raid’s task system to persist variables across runs and makes variable expansion prefer persisted “raid vars” over OS/.env values. It also refactors JSON schema embedding so validation loads schemas from a new top-level embedded schemas.FS.

Changes:

  • Add Set task type (schema, docs, examples) and wire it into task execution + expansion.
  • Introduce a persisted raid variable store (vars file) and expandRaid() expansion semantics.
  • Move embedded schema loading to the top-level schemas package (schemas.FS).

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/resources/app.properties Bumps app version to 0.4.0-beta.
src/internal/lib/task_runner_extra_test.go Adds tests for Set task behavior, expansion, and precedence.
src/internal/lib/task_runner.go Dispatches new Set task, uses expandRaid for Template/Print, implements execSetVar.
src/internal/lib/task.go Adds Value field, introduces SetVar task type, routes expansion through expandRaid.
src/internal/lib/schemas/raid-repo.schema.json Removes old embedded schema copy.
src/internal/lib/schemas/raid-profile.schema.json Removes old embedded schema copy.
src/internal/lib/schemas/raid-defs.schema.json Removes old embedded schema copy.
src/internal/lib/lib.go Adds persisted raid var store + expandRaid, resets/loads vars on ForceLoad, switches schema embedding to schemas.FS.
schemas/raid-defs.schema.json Adds schema definition for Set task.
schemas/fs.go Adds embedded schema filesystem (schemas.FS).
profile.raid.yml Adds an example profile demonstrating Set.
README.md Documents the new Set task type and usage.

Comment thread src/internal/lib/lib.go
Comment thread src/internal/lib/lib.go Outdated
Comment thread src/internal/lib/task_runner.go
Comment thread src/internal/lib/task_runner.go Outdated
8bitAlex and others added 2 commits March 17, 2026 18:55
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.89%. Comparing base (419e2e9) to head (d616a7f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/internal/lib/task_runner.go 60.00% 7 Missing and 7 partials ⚠️
src/internal/lib/lib.go 63.63% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
- Coverage   72.41%   71.89%   -0.53%     
==========================================
  Files          27       27              
  Lines        1479     1544      +65     
==========================================
+ Hits         1071     1110      +39     
- Misses        368      387      +19     
- Partials       40       47       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@8bitAlex 8bitAlex merged commit 5fc63e0 into main Mar 18, 2026
5 of 7 checks passed
@8bitAlex 8bitAlex deleted the Set-Task-Type branch March 18, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants