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

v0.46.0 > Release #3564

Merged
merged 634 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
634 commits
Select commit Hold shift + click to select a range
ac09958
Merge branch 'version/0-46-0-RC1' into mitchell/dx-2940
mitchell-as Jul 26, 2024
156fb56
Fixed failing integration test.
mitchell-as Jul 26, 2024
5c94684
Merge pull request #3408 from ActiveState/mitchell/dx-2940
mitchell-as Jul 26, 2024
16b5648
Merge pull request #3417 from ActiveState/mitchell/dx-2971
mitchell-as Jul 26, 2024
6d00a35
Add explicit integration test
MDrakos Jul 26, 2024
9281598
`state import` with SBOMs should still update the commit.
mitchell-as Jul 29, 2024
c79d6c0
Use buildplanner ImpactReport endpoint to show change summary.
mitchell-as Jul 26, 2024
716883d
Consider a folder with the install dir marker to be an installation r…
mitchell-as Jul 29, 2024
f1f8ab0
`state import` should always update the local commit, even if solving…
mitchell-as Jul 29, 2024
78bb900
Merge pull request #3415 from ActiveState/mitchell/dx-2881
mitchell-as Jul 29, 2024
27cbf09
Merge pull request #3418 from ActiveState/mitchell/dx-2977
mitchell-as Jul 29, 2024
4820ac3
Merge branch 'version/0-46-0-RC1' into mitchell/dx-2955
mitchell-as Jul 29, 2024
dd0c713
Merge pull request #3382 from ActiveState/DX-2892
MDrakos Jul 29, 2024
d8be069
StageCommit returns a build
MDrakos Jul 29, 2024
8d7542c
Only send buildexpressions to ImpactReport.
mitchell-as Jul 30, 2024
7697834
Use Platform URLs instead of S3 URLs for user update requests.
mitchell-as Jul 30, 2024
03c5e90
Merge pull request #3422 from ActiveState/mitchell/dx-2769
mitchell-as Jul 30, 2024
0368182
Also pass impact report to cve runbit, even though it cannot yet be f…
mitchell-as Jul 30, 2024
ea73065
Add back mistakenly deleted locale message.
mitchell-as Jul 31, 2024
d9e2af4
Attempt to fix failing integration test.
mitchell-as Jul 31, 2024
5f3f04a
Error types should satisfy error interface instead of embedding error…
mitchell-as Jul 31, 2024
bf33c07
Make trailing newline in command help more consistent.
mitchell-as Jul 31, 2024
f4695e5
Include local history when checking if a commit exists in a project.
mitchell-as Jul 31, 2024
b29bf80
Merge pull request #3426 from ActiveState/mitchelll/dx-2964
mitchell-as Jul 31, 2024
d554a50
Merge pull request #3425 from ActiveState/mitchell/dx-2788
mitchell-as Jul 31, 2024
d661c98
Merge pull request #3427 from ActiveState/mitchelll/dx-2965
mitchell-as Jul 31, 2024
12d84fa
Merge pull request #3423 from ActiveState/mitchell/dx-2970
mitchell-as Jul 31, 2024
954fc3a
Merge branch 'version/0-46-0-RC1' into mitchell/dx-2958
mitchell-as Jul 31, 2024
607fc0e
Merge pull request #3424 from ActiveState/mitchell/dx-2958
mitchell-as Jul 31, 2024
b47e058
PR feedback.
mitchell-as Jul 31, 2024
95f1adb
Simplify ImpactReport API.
mitchell-as Jul 31, 2024
928e86b
Simplified ChangeSummary API.
mitchell-as Jul 31, 2024
ab3b898
Merge branch 'version/0-46-0-RC1' into mitchell/dx-2955
mitchell-as Jul 31, 2024
33df984
Merge branch version/0-45-1-RC1 to adopt changes from PR #3429
as-builds Jul 31, 2024
1d66f33
Merge pull request #3419 from ActiveState/mitchell/dx-2955
mitchell-as Aug 1, 2024
fe00e88
Do not assume there is a local history when checking if a commit is w…
mitchell-as Aug 1, 2024
d1ce45d
Use volume-specific depot for Windows runtimes not on the main volume.
mitchell-as Aug 1, 2024
52df9e6
Do not concern the runtime with depot drive problems.
mitchell-as Aug 1, 2024
706b4e9
Merge branch 'version/0-46-0-RC1' into DX-2934
MDrakos Aug 1, 2024
22259e9
Fix panic
MDrakos Aug 1, 2024
3ee0685
Added comment based on PR feedback.
mitchell-as Aug 2, 2024
9c3dd32
Validate volumes before linking on Windows.
mitchell-as Aug 2, 2024
eb977f7
Merge pull request #3431 from ActiveState/mitchell/dx-2992
mitchell-as Aug 2, 2024
e69ad12
Change summary should only output line separator if there is a summar…
mitchell-as Aug 2, 2024
c761c6e
Output trailing line separator for CVE info.
mitchell-as Aug 2, 2024
e57fcfe
Make clone errors input errors.
mitchell-as Aug 2, 2024
81fddfe
Process build error
MDrakos Aug 2, 2024
b25a6ef
Fixed failing integration test.
mitchell-as Aug 2, 2024
bb7e9a1
Merge pull request #3435 from ActiveState/mitchell/dx-2991
mitchell-as Aug 2, 2024
e3c12f7
Merge pull request #3434 from ActiveState/mitchell/dx-2975
mitchell-as Aug 5, 2024
8765ef5
Merge pull request #3433 from ActiveState/mitchell/dx-2962
mitchell-as Aug 5, 2024
0d53ee0
Remove Windows shortcuts during uninstall.
mitchell-as Aug 5, 2024
b7c7b63
Also validate volumes before copying.
mitchell-as Aug 6, 2024
dcdc9bd
Remote installer should forward "--force" to installer.
mitchell-as Aug 5, 2024
41db1df
Verify that shortcuts are created on install.
mitchell-as Aug 6, 2024
e7768ac
Merge pull request #3439 from ActiveState/mitchell/dx-2993-3
mitchell-as Aug 6, 2024
ffa9c68
Merge pull request #3440 from ActiveState/mitchell/dx-2853
mitchell-as Aug 6, 2024
513da94
Merge pull request #3432 from ActiveState/mitchell/dx-2943
mitchell-as Aug 6, 2024
097b140
Merge branch 'version/0-46-0-RC1' into DX-2934
MDrakos Aug 6, 2024
781f2fa
Don't create new commit variable
MDrakos Aug 7, 2024
6f088b5
Remove redundant solve
MDrakos Aug 7, 2024
3527b20
Add timeout
MDrakos Aug 7, 2024
c3306fd
Merge pull request #3420 from ActiveState/DX-2934
MDrakos Aug 9, 2024
a225c1b
Log all args in CI tests and on dev machines.
mitchell-as Aug 12, 2024
669fbcd
Commit WIP
MDrakos Aug 12, 2024
d695173
Fix powershell not opening when execution policy restricted
Naatan Aug 12, 2024
b1a8efa
Add line ending
Naatan Aug 12, 2024
6ff1b5a
Merge pull request #3442 from ActiveState/mitchell/dx-2983
mitchell-as Aug 12, 2024
57f5e94
Revert using buildplanner ImpactReport endpoint to show change summary.
mitchell-as Aug 13, 2024
5b48da3
Initial implementation of `state checkout --from-archive`.
mitchell-as Aug 12, 2024
89dd3ec
Make org/namespace an optional argument since --from-archive does not…
mitchell-as Aug 13, 2024
78c04c7
`state checkout --from-archive` integration test should not need the …
mitchell-as Aug 13, 2024
07ba385
Fix unit test failure
Naatan Aug 13, 2024
cdb1408
Check build status after commit
MDrakos Aug 13, 2024
a2921a0
Merge pull request #3443 from ActiveState/DX-2852
Naatan Aug 13, 2024
e385ae6
Merge pull request #3446 from ActiveState/DX-2934
MDrakos Aug 13, 2024
e9f0904
Merge branch 'version/0-46-0-RC1' into DX-2966
MDrakos Aug 13, 2024
0bb4d84
Merge branch 'version/0-46-0-RC1' into mitchell/dx-3007
mitchell-as Aug 13, 2024
c8c14b6
Merge pull request #3445 from ActiveState/mitchell/dx-3007
mitchell-as Aug 14, 2024
5164883
Merge branch 'version/0-46-0-RC1' into DX-2966
MDrakos Aug 14, 2024
a21d536
Reorganize
MDrakos Aug 14, 2024
59bf4a7
Allow passing checkout archive as namespace argument.
mitchell-as Aug 14, 2024
1a878e6
Use constants for checkout archive files.
mitchell-as Aug 14, 2024
08b1feb
Wrap error.
mitchell-as Aug 14, 2024
89f2114
Move requirement logic inside report function
MDrakos Aug 14, 2024
7cf19c8
Extract method.
mitchell-as Aug 14, 2024
dfdf8ac
Use switch to clarify relations.
mitchell-as Aug 14, 2024
6b540bd
Rename option for readability.
mitchell-as Aug 14, 2024
b889013
Group runtime setup from archive options into a single struct.
mitchell-as Aug 14, 2024
ba718c4
Still fire download events when setting up from an archive.
mitchell-as Aug 14, 2024
78ffd03
Assert checkout from archive installs runtime files.
mitchell-as Aug 14, 2024
9ad4079
Remove unused field.
mitchell-as Aug 15, 2024
a03e3de
Rename argument.
mitchell-as Aug 15, 2024
f251055
Remove debug logging.
mitchell-as Aug 15, 2024
787aafa
Use buildplan for requirements calculation
MDrakos Aug 15, 2024
836f8a8
Applied PR feedback.
mitchell-as Aug 15, 2024
c193c9f
Separate artifacts to download from artifacts to unpack from archive.
mitchell-as Aug 15, 2024
fc61192
Change summary shows added dependencies for updates.
mitchell-as Aug 15, 2024
528fb3e
Add separate stagecommit method
MDrakos Aug 15, 2024
13bff0c
Show CVE info during `state checkout`.
mitchell-as Aug 16, 2024
72d1f0b
Cleanup namespace detection
Naatan Aug 16, 2024
d694c07
Remove unnecessary logic
Naatan Aug 16, 2024
acc92f3
Explicitly iterate over updated artifacts to look for added direct de…
mitchell-as Aug 16, 2024
d597f50
Show all dependencies on
MDrakos Aug 16, 2024
325c0fb
Revert changes made my import formatter
MDrakos Aug 16, 2024
e0de8ac
Merge pull request #3451 from ActiveState/nathan/DX-2981
Naatan Aug 16, 2024
f732f7e
Update integration test
MDrakos Aug 16, 2024
0b3216e
Merge pull request #3448 from ActiveState/mitchell/dx-2930
mitchell-as Aug 16, 2024
34cf30c
Merge pull request #3444 from ActiveState/mitchell/dx-2981
mitchell-as Aug 16, 2024
c1dc2a2
Return partial commit on failure
MDrakos Aug 16, 2024
13896e0
Remove expect
MDrakos Aug 16, 2024
2edb970
Merge remote-tracking branch 'origin/DX-2966' into mitchell/dx-2921
mitchell-as Aug 16, 2024
584f12a
CveReport should not assume there is an old build plan to reference.
mitchell-as Aug 16, 2024
80a3671
Fix panic
MDrakos Aug 16, 2024
c3cab7e
Merge branch 'version/0-46-0-RC1' into mitchell/dx-2921
mitchell-as Aug 16, 2024
3e6cbfb
Disable cve security prompt for docker checkout test.
mitchell-as Aug 16, 2024
a5861d9
Merge pull request #3452 from ActiveState/DX-3003
MDrakos Aug 16, 2024
d36ba8a
Merge pull request #3449 from ActiveState/DX-3008
MDrakos Aug 16, 2024
1e2073d
Merge branch 'version/0-46-0-RC1' into DX-2966
MDrakos Aug 16, 2024
e93bdae
Merge pull request #3447 from ActiveState/DX-2966
MDrakos Aug 16, 2024
b57860a
Fixed regression in checking out with a specific commitID.
mitchell-as Aug 19, 2024
37545fc
Merge branch 'version/0-46-0-RC1' into mitchell/dx-2921
mitchell-as Aug 19, 2024
d319723
Merge pull request #3453 from ActiveState/mitchell/dx-3014
mitchell-as Aug 19, 2024
5a23b1b
Merge pull request #3450 from ActiveState/mitchell/dx-2921
mitchell-as Aug 19, 2024
9aba7d0
Fixed disabling of security prompts in e2e tests.
mitchell-as Aug 20, 2024
d9d6352
Merge pull request #3454 from ActiveState/mitchell/dx-3018
mitchell-as Aug 20, 2024
1b30be2
If two artifacts provide the same file, re-link or re-copy that file …
mitchell-as Aug 20, 2024
eca219b
Add support for cycles
MDrakos Aug 20, 2024
07da8aa
Remove debug logs
MDrakos Aug 20, 2024
d8ddb0c
Fix manifest CVEs
MDrakos Aug 21, 2024
c501373
Harmonize runtime sourcing messages across runners.
mitchell-as Aug 21, 2024
ff1ad11
Merge pull request #3457 from ActiveState/DX-2997
MDrakos Aug 21, 2024
4eda2f2
Iterate over declared deployment files, not what's on disk.
mitchell-as Aug 21, 2024
c8ce0a5
Implement multi-spinner. Non-interactive has unpolished UI/UX at this…
Naatan Aug 21, 2024
0b7c404
Revert "Implement multi-spinner. Non-interactive has unpolished UI/UX…
Naatan Aug 21, 2024
a8827ea
Drop the commit progress spinner, instead everything is handled under…
Naatan Aug 21, 2024
fc84551
Smartlink.Link() should create directories as needed.
mitchell-as Aug 22, 2024
845e392
Break after finding a shared file.
mitchell-as Aug 22, 2024
53edce9
Drop commit progress from import as well
Naatan Aug 22, 2024
cb059c1
Merge pull request #3458 from ActiveState/mitchell/dx-2929
mitchell-as Aug 22, 2024
ecd356b
Merge remote-tracking branch 'origin/version/0-46-0-RC1' into DX-3016
Naatan Aug 22, 2024
3aa4976
Cleanup per PR feedback.
mitchell-as Aug 22, 2024
5ab1e8e
Fix tests
Naatan Aug 22, 2024
cd58629
Merge pull request #3459 from ActiveState/DX-3016
Naatan Aug 22, 2024
cc37a2a
Merge pull request #3455 from ActiveState/mitchell/dx-2913
mitchell-as Aug 22, 2024
6a1a242
Add more unit tests
MDrakos Aug 22, 2024
afab365
Update comments
MDrakos Aug 22, 2024
cf76af6
Enable tests and remove debug prints
MDrakos Aug 22, 2024
bd82284
Merge pull request #3456 from ActiveState/DX-3002
MDrakos Aug 23, 2024
cab0b0b
First attempt using aquasecurity/trivy-action to scan for CVEs during…
mitchell-as Aug 26, 2024
e6b1079
Address CVEs reported by trivy.
mitchell-as Aug 26, 2024
4eecaab
Ignore unfixed CVEs.
mitchell-as Aug 26, 2024
6410f3e
Scan all OS-specific binaries from a Linux container.
mitchell-as Aug 27, 2024
fa61840
Attempt to show scanned files/packages.
mitchell-as Aug 28, 2024
5123958
Merge pull request #3461 from ActiveState/mitchell/dx-2978-2
mitchell-as Aug 28, 2024
09eacdf
Fixed queries with no arguments.
mitchell-as Aug 29, 2024
9065ff1
Merge pull request #3468 from ActiveState/mitchell/dx-3034
mitchell-as Aug 29, 2024
f99747e
Prevent concurrency errors with envdef loading.
mitchell-as Aug 30, 2024
1aedb1c
Merge pull request #3469 from ActiveState/mitchell/dx-3009
mitchell-as Sep 3, 2024
b06d58d
Do not output CVE report or prompt when in structured output mode.
mitchell-as Sep 3, 2024
ad73915
Merge pull request #3473 from ActiveState/mitchell/dx-3036
mitchell-as Sep 3, 2024
8b53eb9
Do not re-link or re-copy a deployed file if it still exists.
mitchell-as Sep 4, 2024
201a1fc
Revert "Do not re-link or re-copy a deployed file if it still exists."
mitchell-as Sep 4, 2024
566ec7f
When re-linking or re-copying, ignore outside deployments.
mitchell-as Sep 4, 2024
0880873
Merge pull request #3477 from ActiveState/mitchell/dx-3037
mitchell-as Sep 4, 2024
dd10ee5
Merge pull request #3465 from ActiveState/mitchell/dx-3012
mitchell-as Aug 28, 2024
162fb93
Merge pull request #3479 from ActiveState/mitchell/dx-3012-2
mitchell-as Sep 5, 2024
fe2051f
Filter artifacts for reporting
MDrakos Sep 5, 2024
05c344f
Ignore log file for current process
MDrakos Sep 6, 2024
1162387
Fix unit tests
MDrakos Sep 6, 2024
0d2a7ae
Add raw buildplan for reference
MDrakos Sep 6, 2024
dd41b0c
Merge pull request #3482 from ActiveState/DX-2892
MDrakos Sep 6, 2024
56a14f9
Remove raw buildplan
MDrakos Sep 10, 2024
1151bde
Wrong libc should be an input error.
mitchell-as Sep 11, 2024
544d342
Update deprecated GitHub Actions.
mitchell-as Sep 10, 2024
dbf0ec8
Update unit test to reflect new bash path on GitHub Actions Windows r…
mitchell-as Sep 10, 2024
f9ffd04
Merge pull request #3488 from ActiveState/mitchell/dx-3041
mitchell-as Sep 11, 2024
78732f0
Revert "Filter artifacts for reporting"
Naatan Sep 16, 2024
07fa246
Do not validate commit ID from within projectfile.
mitchell-as Sep 16, 2024
56a1cb4
Merge pull request #3490 from ActiveState/mitchell/dx-3050
mitchell-as Sep 16, 2024
a9c1c8d
Add ability for runners to ignore async runtimes.
mitchell-as Sep 17, 2024
01d8fc4
Address all commands as per DX-2738
Naatan Sep 18, 2024
6c14a81
Fix test timeout
Naatan Sep 18, 2024
929f31e
Sort slices in buildplans so we always have a consistent format to wo…
Naatan Sep 18, 2024
2db48ce
Ensure dependencies returned don't contain duplicates
Naatan Sep 18, 2024
db48964
Only relate ingredients that connect directly to an artifact
Naatan Sep 18, 2024
e8283ce
Fix common dependency calculation
Naatan Sep 18, 2024
816f34c
Test to ensure we only relate ingredients to artifacts that are direc…
Naatan Sep 18, 2024
4343122
Show sub-dependencies if top level ingredient is also a common depend…
Naatan Sep 18, 2024
d2a3519
Merge pull request #3495 from ActiveState/mitchell/dx-3054
Naatan Sep 18, 2024
56e713f
Add FilterOutIngredients
Naatan Sep 18, 2024
7bb259f
Drop testing code
Naatan Sep 18, 2024
7f47fb8
Skip test that has its own issues
Naatan Sep 18, 2024
1abf130
Fix import cycle
Naatan Sep 18, 2024
b2342b7
Merge pull request #3498 from ActiveState/DX-3054
Naatan Sep 18, 2024
97030ae
Rename cleanup to sanitize and move sorting logic there
Naatan Sep 19, 2024
da1e745
Rename cleanup to sanitize and move sorting logic there
Naatan Sep 19, 2024
7a6ccc1
Remove unused mimetypes
Naatan Sep 19, 2024
948ebeb
Merge pull request #3496 from ActiveState/nathan/DX-3039
Naatan Sep 20, 2024
255d3f9
Test for hardlink support on Windows before doing it.
mitchell-as Sep 23, 2024
84273fa
Cleanup hard link checking.
mitchell-as Sep 23, 2024
03f30b1
Setup is responsible for knowing if the depot supports hard links or …
mitchell-as Sep 24, 2024
2219141
Fix nil pointer panic
Naatan Sep 24, 2024
bfedd74
Satisfy check-format
Naatan Sep 24, 2024
4087d13
Setup is responsible for determining hardlink support, not the depot.
mitchell-as Sep 24, 2024
bc69a84
Merge pull request #3504 from ActiveState/DX-3072
Naatan Sep 24, 2024
a93e6a1
If buildscripts are enabled, `state refresh` without a buildscript sh…
mitchell-as Sep 24, 2024
fdcf750
Merge branch 'version/0-46-0-RC1' into mitchell/dx-2943
mitchell-as Sep 24, 2024
f9f94b5
Merge branch 'version/0-46-0-RC1' into mitchell/dx-3073
mitchell-as Sep 24, 2024
2a2d4d7
Move hard link detection into constructor so it's only done once.
mitchell-as Sep 24, 2024
71e9128
Apply PR feedback suggestions.
mitchell-as Sep 24, 2024
847e40a
Requirements aren't guaranteed to resolve
Naatan Sep 24, 2024
99fd378
Don't enforce artifact <-> ingredient relation as artifacts produced …
Naatan Sep 24, 2024
d4008ea
Apply more PR feedback.
mitchell-as Sep 25, 2024
8550d6b
Merge pull request #3507 from ActiveState/mitchell/dx-3073
mitchell-as Sep 25, 2024
899fa42
Support identifying source behind python wheel
Naatan Sep 25, 2024
6a9f844
Drop unused code
Naatan Sep 25, 2024
51af785
Merge pull request #3502 from ActiveState/mitchell/dx-2943
mitchell-as Sep 25, 2024
70dc6a4
Don't enforce zero ingredient check
Naatan Sep 25, 2024
e69e7b9
Fix artifacts being filtered out just because they have no ingredient
Naatan Sep 25, 2024
4999497
Fix panic on simultaneous map write
Naatan Sep 25, 2024
2bca991
Add comment
Naatan Sep 25, 2024
b7b933f
Fix test
Naatan Sep 25, 2024
64d3b2a
Merge pull request #3508 from ActiveState/DX-3066
Naatan Sep 26, 2024
6aefa97
Added changelog for v0.46.0
Naatan Oct 4, 2024
3854aab
Update version.txt
Oct 10, 2024
89d6af3
Added v0.45.1 changelog entry
Naatan Jul 31, 2024
4436e4d
Merge branch 'version/0-46-0-RC1' into version/0-46-0-RC2
Naatan Oct 11, 2024
a09880c
Merge branch 'beta' into version/0-46-0-RC1
Naatan Oct 11, 2024
6df75bd
Merge pull request #3349 from ActiveState/version/0-46-0-RC1
Naatan Oct 11, 2024
e18b1b7
Marshal BuildPlan and not BuildExpression
MDrakos Oct 11, 2024
eebc58f
Update test
MDrakos Oct 11, 2024
3ea813f
Add missing newline
MDrakos Oct 11, 2024
5522e48
Update test
MDrakos Oct 11, 2024
4d6af39
Fix repeated output
MDrakos Oct 15, 2024
824c198
Add newline
MDrakos Oct 15, 2024
6d7a124
Add comment
MDrakos Oct 15, 2024
f521629
Remove debug log
MDrakos Oct 15, 2024
eabb513
Merge pull request #3540 from ActiveState/DX-3103
MDrakos Oct 15, 2024
b051962
Merge pull request #3541 from ActiveState/DX-3102
MDrakos Oct 15, 2024
9151dcb
Merge pull request #3535 from ActiveState/version/0-46-0-RC2
Naatan Oct 16, 2024
c3b9e85
Update version.txt
Oct 17, 2024
1f41910
Fix env ordering
MDrakos Oct 17, 2024
8bde15e
Increase timeout
MDrakos Oct 17, 2024
aa24624
Only swap path environment variables
MDrakos Oct 18, 2024
1fe5107
Promote path
MDrakos Oct 18, 2024
7029a4c
Add comment
MDrakos Oct 18, 2024
97813a8
Move logic
MDrakos Oct 18, 2024
1c7e526
Merge pull request #3548 from ActiveState/DX-3116
MDrakos Oct 18, 2024
6ccb08f
Merge pull request #3546 from ActiveState/version/0-46-0-RC3
Naatan Oct 21, 2024
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
Prev Previous commit
Next Next commit
Sort slices in buildplans so we always have a consistent format to wo…
…rk with
  • Loading branch information
Naatan committed Sep 18, 2024
commit 929f31eb2a15ff4ed906256289dbd8399321e850
33 changes: 32 additions & 1 deletion pkg/buildplan/buildplan.go
Original file line number Diff line number Diff line change
@@ -2,7 +2,11 @@ package buildplan

import (
"encoding/json"
"fmt"
"sort"
"time"

"github.com/ActiveState/cli/internal/fileutils"
"github.com/go-openapi/strfmt"

"github.com/ActiveState/cli/internal/errs"
@@ -32,6 +36,33 @@ func Unmarshal(data []byte) (*BuildPlan, error) {

b.cleanup()

// Sort buildplan slices to ensure consistency, because the API does not guarantee a consistent ordering
sort.Slice(b.raw.Sources, func(i, j int) bool { return b.raw.Sources[i].NodeID < b.raw.Sources[j].NodeID })
sort.Slice(b.raw.Steps, func(i, j int) bool { return b.raw.Steps[i].StepID < b.raw.Steps[j].StepID })
sort.Slice(b.raw.Artifacts, func(i, j int) bool { return b.raw.Artifacts[i].NodeID < b.raw.Artifacts[j].NodeID })
sort.Slice(b.raw.Terminals, func(i, j int) bool { return b.raw.Terminals[i].Tag < b.raw.Terminals[j].Tag })
sort.Slice(b.raw.ResolvedRequirements, func(i, j int) bool {
return b.raw.ResolvedRequirements[i].Source < b.raw.ResolvedRequirements[j].Source
})
for _, t := range b.raw.Terminals {
sort.Slice(t.NodeIDs, func(i, j int) bool { return t.NodeIDs[i] < t.NodeIDs[j] })
}
for _, a := range b.raw.Artifacts {
sort.Slice(a.RuntimeDependencies, func(i, j int) bool { return a.RuntimeDependencies[i] < a.RuntimeDependencies[j] })
}
for _, step := range b.raw.Steps {
sort.Slice(step.Inputs, func(i, j int) bool { return step.Inputs[i].Tag < step.Inputs[j].Tag })
sort.Slice(step.Outputs, func(i, j int) bool { return step.Outputs[i] < step.Outputs[j] })
for _, input := range step.Inputs {
sort.Slice(input.NodeIDs, func(i, j int) bool { return input.NodeIDs[i] < input.NodeIDs[j] })
}
}

v, _ := b.Marshal()
vs := string(v)
_ = vs
fileutils.WriteFile(fmt.Sprintf("/tmp/buildplan-%d.json", time.Now().Unix()), v)

if err := b.hydrate(); err != nil {
return nil, errs.Wrap(err, "error hydrating build plan")
}
@@ -45,7 +76,7 @@ func Unmarshal(data []byte) (*BuildPlan, error) {
}

func (b *BuildPlan) Marshal() ([]byte, error) {
return json.Marshal(b.raw)
return json.MarshalIndent(b.raw, "", " ")
}

// cleanup empty targets