Skip to content

Rename scripts to actions#463

Merged
dmitry-lyfar merged 3 commits into
mainfrom
chore/scripts-renamed-actions
Sep 2, 2025
Merged

Rename scripts to actions#463
dmitry-lyfar merged 3 commits into
mainfrom
chore/scripts-renamed-actions

Conversation

@jonathan-conder
Copy link
Copy Markdown
Contributor

@jonathan-conder jonathan-conder commented Aug 25, 2025

Description

Workshop scripts are now called workshop actions. One thing I didn't change is this output:

$ workshop actions dev
all:
  script: npm run all -- "$@"
format:
  script: npm run format:write -- "$@"
inspect:
  script: npm run inspect -- "$@"
install:
  script: npm ci -- "$@"
lint:
  script: npm run lint -- "$@"
test:
  script: npm run test -- "$@"

In other words, script is one of the fields within an action. At the moment it's the only field, but we might add more later (e.g. uid and gid).

I happened to notice that we haven't fully migrated to the standard library maps and slices, so I did that and fixed a few issues related to that.

Existing workshop definitions (with scripts:) will be supported until we decide to revert the "Support scripts in addition to actions" commit. However, this PR may break existing workshops due to the internal representation being different. Also, old clients won't be fully compatible with new daemons, and vice versa.

Self-review quick check

  • Make decisions that cost a lot to reverse explicit in the PR description.
  • Avoid nested conditions.
  • Delete dead code and redundant comments.
  • Normalise symmetries by sticking to doing identical things identically.
// one way to handle errors
if err := f(); err != nil {
   ...
}

// one way to handle multiple returns
val, err := f()
if err != nil {
   ...
}
...
  • Check that coupled code elements, files, and directories are adjacent. For example, test data is stored as close as possible to a test.
  • Put variable declaration and initialisation together.
  • Divide large expressions into digestable and self-explanatory ones. Use multiple variables if required.
  • Put a blank line between two logically different chunks of code.
  • Follow the style guide for new error messages.

Docs

  • I have checked and added or updated relevant documentation.
  • I have checked and added or updated relevant release notes.
  • I have included the technical author in the review.

Or:

  • I confirm the PR has no implications for documentation.

@jonathan-conder jonathan-conder self-assigned this Aug 25, 2025
@jonathan-conder jonathan-conder force-pushed the chore/scripts-renamed-actions branch 2 times, most recently from 8e98c95 to 015b0cd Compare August 29, 2025 05:00
This should be removed after workshop authors have had a chance to
update their definition files.
@jonathan-conder jonathan-conder force-pushed the chore/scripts-renamed-actions branch from 015b0cd to 1165d93 Compare August 29, 2025 06:14
@jonathan-conder jonathan-conder marked this pull request as ready for review August 29, 2025 06:15
@github-actions
Copy link
Copy Markdown

TICS Quality Gate

✔️ Passed

workshop

All conditions passed

See the results in the TICS Viewer

The following files have been checked for this project
  • client/exec.go
  • client/workshop.go
  • cmd/workshop/changes.go
  • cmd/workshop/exec.go
  • cmd/workshop/list.go
  • cmd/workshop/root.go
  • cmd/workshop/tasks.go
  • internal/daemon/api_changes.go
  • internal/daemon/api_exec.go
  • internal/daemon/api_workshops.go
  • internal/daemon/api.go
  • internal/dirs/dirs.go
  • internal/interfaces/policy/helpers.go
  • internal/interfaces/repo.go
  • internal/jsonutil/json.go
  • internal/overlord/cmdstate/handlers.go
  • internal/overlord/cmdstate/manager.go
  • internal/overlord/ifacestate/handlers.go
  • internal/overlord/workshopstate/manager.go
  • internal/overlord/workshopstate/request.go
  • internal/sdk/local.go
  • internal/sdk/validate.go
  • internal/workshop/fakebackend/backend.go
  • internal/workshop/lxd/lxd_backend.go
  • internal/workshop/workshop_file.go
  • internal/wsutil/wsutil.go

Automatic-tests / code-coverage / TICS GitHub Action

@dmitry-lyfar dmitry-lyfar merged commit 2d2feb1 into main Sep 2, 2025
13 checks passed
@dmitry-lyfar dmitry-lyfar deleted the chore/scripts-renamed-actions branch September 2, 2025 05:21
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.

3 participants