Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts -> Actions #1144

Merged
merged 105 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
69f74dc
initial commit
jeff-mccoy Dec 27, 2022
aae1112
add some random slice helpers
jeff-mccoy Dec 27, 2022
28fdd03
annoy jon, cleanup remove logic, add actions.remove.*
jeff-mccoy Dec 27, 2022
82cbfcd
reverse slice index fun
jeff-mccoy Dec 27, 2022
a7ea0ca
Refactor execCommand to support more config options
jeff-mccoy Dec 27, 2022
f856abf
preserve os env vars when given env vars
jeff-mccoy Dec 27, 2022
fe01b61
WithPrint() -> PrintCfg()
jeff-mccoy Dec 27, 2022
b929dc8
breakup pr
jeff-mccoy Dec 29, 2022
30868ab
docs and schema
jeff-mccoy Dec 29, 2022
a7a623b
remove files.extract
jeff-mccoy Dec 29, 2022
814bb4f
Move migrations to their own package to keep things less messy
jeff-mccoy Dec 31, 2022
ea47cea
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 2, 2023
4913c96
schema updates & add default configs
jeff-mccoy Jan 4, 2023
c8cbdf7
Merge remote-tracking branch 'origin/jeff-doing-stupid-jeff-things' i…
jeff-mccoy Jan 4, 2023
210a329
docs and tests wip
jeff-mccoy Jan 4, 2023
e7ba122
be smart about unlimited time
jeff-mccoy Jan 4, 2023
3970a51
more changes based on iac meeting today
jeff-mccoy Jan 5, 2023
eb7f69b
schema update
jeff-mccoy Jan 5, 2023
7c8695d
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 6, 2023
1475d6f
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 6, 2023
0d0960a
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 8, 2023
e839ff5
lint things
jeff-mccoy Jan 8, 2023
caf4b59
Merge branch 'main' into jeff-doing-stupid-jeff-things
Racer159 Jan 10, 2023
158375f
PR notes cleanup
jeff-mccoy Jan 12, 2023
9a3d029
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 12, 2023
99e8780
wip more component lifecycle detail
jeff-mccoy Jan 12, 2023
1e37697
Merge branch 'main' into jeff-doing-stupid-jeff-things
Racer159 Jan 12, 2023
2ecb60c
more docs
jeff-mccoy Jan 13, 2023
d7daf0d
add deploy-time variables to action env
jeff-mccoy Jan 13, 2023
19dedde
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 13, 2023
23894db
also add TF_VAR env variables
jeff-mccoy Jan 13, 2023
65eb222
Cleanup Icon component implementation (#1183)
Noxsios Jan 13, 2023
dd0ada8
Update dependency @sveltejs/kit to v1.0.13 (#1200)
renovate[bot] Jan 13, 2023
e5f878f
Update dependency @sveltejs/adapter-static to v1.0.2 (#1201)
renovate[bot] Jan 14, 2023
40bb3e1
Update dependency prettier to v2.8.3 (#1202)
renovate[bot] Jan 14, 2023
7504c15
Push both a crc and non-crc image tag for zarf images (#1203)
Racer159 Jan 14, 2023
0a2e4ae
Update dependency @sveltejs/adapter-static to v1.0.3 (#1204)
renovate[bot] Jan 15, 2023
f167e14
Consolidate components flag (#1206)
Racer159 Jan 15, 2023
0798db7
803 add component descriptions to the required components in the init…
Noxsios Jan 15, 2023
929bc64
Use TransformURL over MutateGitURLsInText for the agent (#1207)
Racer159 Jan 15, 2023
13a6afd
add support for actions setVariable for variable sharing
jeff-mccoy Jan 17, 2023
afa0f30
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 17, 2023
2873a32
add file template example with dynamic variables
jeff-mccoy Jan 17, 2023
fc236a9
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 17, 2023
0342ec9
add test to verify deprecated component scripts functionality is stil…
YrrepNoj Jan 18, 2023
2a74a55
increase timeout for external registry test
YrrepNoj Jan 18, 2023
09642ce
start adr + more example work
jeff-mccoy Jan 18, 2023
8519954
Merge remote-tracking branch 'origin/jeff-doing-stupid-jeff-things' i…
jeff-mccoy Jan 18, 2023
08dfddb
actually increase the timeout... and add better logs for the test
YrrepNoj Jan 19, 2023
90653c4
add TF_VAR_name example
jeff-mccoy Jan 19, 2023
771c95d
Merge remote-tracking branch 'origin/jeff-doing-stupid-jeff-things' i…
jeff-mccoy Jan 19, 2023
524ae7d
add tests for component actions functionality
YrrepNoj Jan 19, 2023
bee5666
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 19, 2023
c60c74e
Update 0010-scripts-actions.md
wirewc Jan 19, 2023
3625e6b
convert use of environment variables in commands when running on windows
YrrepNoj Jan 19, 2023
18a6ee0
change runAction parameters to take the defaultCfg instead of the ful…
YrrepNoj Jan 19, 2023
6c2e40a
change componentAction test to debug when using variables in actions
YrrepNoj Jan 19, 2023
2c4eebe
fix regexp for switching environment variables to be windows compatible
YrrepNoj Jan 20, 2023
c4f07ea
change name of environment variable in component-actions example package
YrrepNoj Jan 20, 2023
3ee0548
change name of files produced during deprecated component-scritps
YrrepNoj Jan 20, 2023
f73d8f6
fix filenames in deprecated component scripts test
YrrepNoj Jan 20, 2023
01ec79f
refactor runAction logic into a seperate function
YrrepNoj Jan 20, 2023
bc25b9a
unset scripts after they have been migrated to actions
YrrepNoj Jan 20, 2023
2f61733
remove debugging logs
YrrepNoj Jan 20, 2023
6d21a24
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 21, 2023
b069365
adr cleanup + more docs work
jeff-mccoy Jan 21, 2023
13e4a2c
🫠 use pointers for overridable values--and now wayne is happy
jeff-mccoy Jan 21, 2023
73c327d
Merge branch 'main' into jeff-doing-stupid-jeff-things
Racer159 Jan 21, 2023
84deeeb
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 22, 2023
46658e7
Validate onCreate & onRemove setVariable in addition to onDeploy
jeff-mccoy Jan 22, 2023
cb42c58
Update adr/0011-scripts-actions.md
jeff-mccoy Jan 22, 2023
400099b
Update adr/0011-scripts-actions.md
jeff-mccoy Jan 22, 2023
e9d2eb7
Update adr/0011-scripts-actions.md
jeff-mccoy Jan 22, 2023
21225b0
Update docs/4-user-guide/5-component-actions.md
jeff-mccoy Jan 22, 2023
d3fd9ec
Update docs/4-user-guide/5-component-actions.md
jeff-mccoy Jan 22, 2023
f381d0c
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 23, 2023
c5a5de4
Update src/test/e2e/02_component_actions_test.go
jeff-mccoy Jan 23, 2023
e727809
pr comments
jeff-mccoy Jan 23, 2023
b18c9ac
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 23, 2023
330b5e0
use stdout for script fail error msg
jeff-mccoy Jan 23, 2023
45acf9f
Apply suggestions from code review
jeff-mccoy Jan 23, 2023
17b451c
fix deprecated scripts behavior
jeff-mccoy Jan 23, 2023
6532a28
add templated.txt to test file cleanup
jeff-mccoy Jan 23, 2023
317c476
cleanup crusty old exec command
jeff-mccoy Jan 23, 2023
b230081
Apply suggestions from code review
jeff-mccoy Jan 23, 2023
00a1831
ensure failure actions run on success failures
jeff-mccoy Jan 23, 2023
9d9d0f3
Merge remote-tracking branch 'origin/jeff-doing-stupid-jeff-things' i…
jeff-mccoy Jan 23, 2023
cf4ac50
use variables for eksctl pkg
jeff-mccoy Jan 23, 2023
f2ec9bd
Apply suggestions from code review
jeff-mccoy Jan 23, 2023
019249e
replace init preflight with action onDeploy.before
jeff-mccoy Jan 23, 2023
860e0e2
Merge remote-tracking branch 'origin/jeff-doing-stupid-jeff-things' i…
jeff-mccoy Jan 23, 2023
4f2e493
update template tests
jeff-mccoy Jan 23, 2023
042a8c2
update exec to not try to double-unwrap errs
jeff-mccoy Jan 23, 2023
ef8a2f6
support TF_VAR on windoze
jeff-mccoy Jan 23, 2023
c46bfdf
save removed charts as we are processing a component to be removed
YrrepNoj Jan 23, 2023
a7e7b37
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 23, 2023
4fe3da7
track migrations in zarf.yaml build data
jeff-mccoy Jan 24, 2023
7f9da09
lint things
jeff-mccoy Jan 24, 2023
02361c3
Merge branch 'main' into jeff-doing-stupid-jeff-things
jeff-mccoy Jan 24, 2023
f5db629
only trim action setVariable
jeff-mccoy Jan 24, 2023
f9c57f9
Merge remote-tracking branch 'origin/jeff-doing-stupid-jeff-things' i…
jeff-mccoy Jan 24, 2023
96f83e9
add remove test & notes for setvariable usage
jeff-mccoy Jan 24, 2023
ec9a6ec
Update src/cmd/internal.go
jeff-mccoy Jan 24, 2023
afaefe5
Update src/cmd/internal.go
jeff-mccoy Jan 24, 2023
bb3f088
remove scripts from deploy if migrated
jeff-mccoy Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ build-examples: ## Build all of the example packages

@test -s ./build/zarf-package-dos-games-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/game -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-component-scripts-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/component-scripts -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-component-actions-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/component-actions -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-component-choice-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/component-choice -o build -a $(ARCH) --confirm

Expand Down
2 changes: 1 addition & 1 deletion adr/0009-yolo-mode.md → adr/0010-yolo-mode.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 9. YOLO Mode
# 10. YOLO Mode

Date: 2022-12-14

Expand Down
27 changes: 27 additions & 0 deletions adr/0011-scripts-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 11. Scripts -> Actions

Date: 2023-01-18

## Status

Accepted

## Context

Originally, the `scripts` noun was added to components to allow us to move hard-coded init business logic out of the codebase and into the package system. At the time there was only a `before` and `after` section with simply an array entry per command. Later, `prepare` was added as a way to do something during `zarf package create`. As teams began to find new ways to use the capabilities, their limitations became more obvious.

## Decision

The `scripts` section of the `zarf.yaml` will be replaced with a new `actions` section. The `actions` section will be a map of action names to a list of commands to run. `actions` will contain `action sets` that map to the following lifecycle events:

- `onCreate` - Runs during `zarf package create`
- `onDeploy` - Runs during `zarf package deploy`
- `onRemove` - Runs during `zarf package remove`

In addition to adding more lifecycle events, the `actions` section will also allow for more complex actions to be defined. New configurations include, setting the cmd directory, defining custom env variables, setting the number of retries, setting the max total seconds, muting the output, and [setting a variable](../docs/4-user-guide/5-component-actions.md#creating-dynamic-variables-from-actions) to be used in other actions or components.

Further details can be found in the `component-actions` [component actions documentation](../docs/4-user-guide/7-github-action.md), [component lifecycle documentation](../docs/4-user-guide/4-package-command-lifecycle.md), and the [example package](../examples/component-actions/README.md).

## Consequences

With the current team agreement to not introduce breaking changes as we stabilize the API, a deprecation model was introduced that allows existing Zarf binaries to run with older `zarf.yaml` configs while also allowing the new features to be used by those who have updated their Zarf binary.
Loading