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

Ensure build action is set #2723

Closed
wants to merge 199 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
de11caa
Initial implementation of local order file
MDrakos Feb 28, 2023
211dcfa
Remove missing import
MDrakos Feb 28, 2023
cb716c3
Don't use output.Heading
MDrakos Feb 28, 2023
3b59ece
Get requirement operations working
MDrakos Mar 1, 2023
d01648a
Actually return error
MDrakos Mar 2, 2023
2984a8f
Don't return error if file does not exist
MDrakos Mar 2, 2023
a56e6bf
Add TODO
MDrakos Mar 2, 2023
fa39ac3
Merge remote-tracking branch 'origin/DX-1526' into mitchell/dx-1853
mitchell-as May 17, 2023
650d0f3
Fixed merge issue.
mitchell-as May 17, 2023
4497e3c
Merge branch 'DX-1568' into mitchell/dx-1853
mitchell-as May 17, 2023
feca415
Initial batch of changes.
mitchell-as May 17, 2023
6c25749
Remove project path from custom targets.
mitchell-as May 17, 2023
e1c74d9
Fixed build errors.
mitchell-as May 17, 2023
a7ec88f
Another batch of changes.
mitchell-as May 17, 2023
9a597a9
Simplify buildscript update/sync.
mitchell-as May 18, 2023
734d063
Renames to separate build scripts from build expressions.
mitchell-as May 24, 2023
87dd8bb
Update struct tags based on PR feedback.
mitchell-as May 24, 2023
45b78c2
Initial Python-style buildscript read/write support.
mitchell-as May 18, 2023
fc16b2b
Initial support for translating between build scripts and build expre…
mitchell-as May 22, 2023
c10008e
Use String() instead of Write() for writing build scripts.
mitchell-as May 23, 2023
35a6b44
API cleanup based on PR feedback.
mitchell-as May 23, 2023
061704f
Use JSON marshaling for JSON output instead of a custom writer.
mitchell-as May 23, 2023
356e833
Update buildexpression output based on latest changes.
mitchell-as May 23, 2023
fef0b1c
Rerun go mod tidy.
mitchell-as May 23, 2023
37ed3fe
Read and write build expressions directly from JSON.
mitchell-as May 24, 2023
d3f54af
Small changes based on PR feedback.
mitchell-as May 26, 2023
9980862
Inlined buildscript/buildexpression test data instead of reading from…
mitchell-as May 26, 2023
dbf84d9
Replace if/else if with switch.
mitchell-as May 30, 2023
be1582c
Do away with File struct and have functions that work on paths directly.
mitchell-as May 30, 2023
3c5116d
Move commitID from activestate.yaml into its own .activestate/commit …
mitchell-as May 25, 2023
2ed04a4
Remove all instances of commitID= in test URLs.
mitchell-as May 26, 2023
6e0eaa3
Move commits completely out of project.
mitchell-as May 30, 2023
1cda573
Added unit test for localcommit.
mitchell-as May 30, 2023
8a6d76f
Added migration test for commitID in projectfiles.
mitchell-as May 30, 2023
229068c
Local commit file does not have to exist for some state commands.
mitchell-as May 30, 2023
66ceabd
First round of addressing PR feedback.
mitchell-as May 31, 2023
952ba5c
Consolidate localcommit.GetUUID() and localcommit.Get() into one func…
mitchell-as May 31, 2023
f8c8a5c
Fixed final failing tests.
mitchell-as Jun 1, 2023
e334bb7
Improve rollbar logging.
mitchell-as Jun 1, 2023
4ee3d0e
Merge remote-tracking branch 'origin/DX-1828' into mitchell/dx-1853
mitchell-as Jun 2, 2023
4602828
Merge branch 'mitchell/dx-1853' into mitchell/dx-1790
mitchell-as Jun 2, 2023
13f95d5
Initial use of Python-like build scripts.
mitchell-as Jun 2, 2023
c894d23
Merge branch 'DX-1828' into mitchell/dx-1853
mitchell-as Jun 6, 2023
8ed581e
Merge branch 'DX-1828' into mitchell/dx-1790
mitchell-as Jun 6, 2023
4cf2ba8
Merge branch 'DX-1828' into mitchell/dx-1858-2
mitchell-as Jun 6, 2023
ecdcc91
Fixed bad merge.
mitchell-as Jun 6, 2023
2ad8a01
Merge branch 'mitchell/dx-1853' into mitchell/dx-1790
mitchell-as Jun 6, 2023
acc4777
Merge branch 'mitchell/dx-1790' into mitchell/dx-1858-2
mitchell-as Jun 6, 2023
c2aef4e
Fixed build error due to incoming change.
mitchell-as Jun 6, 2023
7a84de8
Handle null values properly in build scripts.
mitchell-as Jun 6, 2023
df60c41
Fixed duplicate "in" field in build scripts.
mitchell-as Jun 6, 2023
13a7396
Enable build script writing.
mitchell-as Jun 6, 2023
3814caf
When running `state pull`, update build script with any merge conflic…
mitchell-as Jun 7, 2023
b672ec1
When pulling in remote build script, do not stage a commit.
mitchell-as Jun 8, 2023
ed0590d
Merge pull request #2549 from ActiveState/mitchell/dx-1853
mitchell-as Jun 9, 2023
5452a04
Merge pull request #2553 from ActiveState/mitchell/dx-1790
mitchell-as Jun 9, 2023
6de564e
Merge branch 'mitchell/dx-1859' into mitchell/dx-1852
mitchell-as Jun 9, 2023
98d5a66
Merge pull request #2558 from ActiveState/mitchell/dx-1852
mitchell-as Jun 9, 2023
496ea91
Added provisional integration test for conflict detection.
mitchell-as Jun 9, 2023
4de0084
PR feedback.
mitchell-as Jun 9, 2023
a9d2977
Merge pull request #2567 from ActiveState/mitchell/dx-1858-2
mitchell-as Jun 12, 2023
6df494e
Merge pull request #2576 from ActiveState/mitchell/dx-1855
mitchell-as Jun 12, 2023
b84e6c1
Update build scripts to take advantage of local commit file.
mitchell-as Jun 12, 2023
687e825
Merge branch 'DX-1828' into mitchell/dx-1859
mitchell-as Jun 12, 2023
0ae170b
Fixed merge issues.
mitchell-as Jun 12, 2023
0ffec8e
Merge branch 'DX-1828' into mitchell/dx-1859
mitchell-as Jun 13, 2023
b8963b6
Notify the user if their build script has local changes.
mitchell-as Jun 14, 2023
f386c1b
Merge branch 'DX-1828' into mitchell/dx-1859
mitchell-as Jun 14, 2023
fa41a6d
Updates after merging.
mitchell-as Jun 14, 2023
e420235
Merge branch 'mitchell/dx-1859' into mitchell/dx-1861
mitchell-as Jun 14, 2023
cd7081d
Updates after merging.
mitchell-as Jun 14, 2023
8b4270f
Store build expression for offline use.
mitchell-as Jun 19, 2023
268e146
Address PR feedback.
mitchell-as Jun 19, 2023
d317f83
Tie cached buildexpression with a commitID.
mitchell-as Jun 19, 2023
5d43429
Merge pull request #2590 from ActiveState/mitchell/dx-1861
mitchell-as Jun 20, 2023
618b2aa
Ensure runtime instance is returned even with err
daved Jun 22, 2023
6281af5
Handle error from build expression storage
daved Jun 22, 2023
15b4e81
Merge pull request #2597 from ActiveState/green/fix_1859_panic.DX-1940
daved Jun 22, 2023
03dd802
Trial add of stage cmd
daved Jun 23, 2023
efb8905
Add commit details to buildscript runbits helper func msgs
daved Jun 23, 2023
bec74ef
Add l10n to buildscript sync failure in stage cmd
daved Jun 23, 2023
33cd03a
Improve stage cmd title in cmdtree
daved Jun 27, 2023
cbe5c5a
Add project nil check to stage runner
daved Jun 27, 2023
835446b
Ensure user is notified of no change in stage cmd
daved Jun 28, 2023
ef750a3
Add stage cmd e2e test
daved Jun 28, 2023
bd334e3
Fix buildscript.Sync call in runbits
daved Jun 28, 2023
55346b2
Ensure json output relays staged status in stage cmd
daved Jun 28, 2023
33d6d78
Remove carry-over from copied code in stage e2e
daved Jun 28, 2023
0eb49f3
Return staged status for errors after staging runs in stage cmd
daved Jun 28, 2023
075b486
Use staged return var in all returns for sync
daved Jun 28, 2023
8aeb6a6
Return false on any error in sync
daved Jun 28, 2023
1f58808
Remove runtime details from stage cmd if no changes found
daved Jun 28, 2023
8b8e77d
Ensure runtime is enabled during stage e2e
daved Jun 28, 2023
60d0fe9
Remove incorrect expect from stage e2e
daved Jun 29, 2023
e183d11
Merge pull request #2603 from ActiveState/green/add_cmd_stage.DX-1857
daved Jun 30, 2023
e9dbd42
Rename `state stage` to `state commit`.
mitchell-as Jul 5, 2023
adb09be
Renamed variable based on PR feedback.
mitchell-as Jul 6, 2023
af8c84d
Merge pull request #2617 from ActiveState/mitchell/dx-1948
mitchell-as Jul 6, 2023
a443a49
Merge branch 'DX-1568' into mitchell/dx-1859
mitchell-as Jul 10, 2023
e7ab2cc
Updated after merge.
mitchell-as Jul 10, 2023
4c54d2f
Handle nil timestamps.
mitchell-as Jul 10, 2023
24258e3
Initial support for auto-merge of build expressions into build script…
mitchell-as Jul 10, 2023
d409ef6
Merge branch 'DX-1568' into mitchell/dx-1859
mitchell-as Jul 12, 2023
5bdb814
Merge branch 'mitchell/dx-1859' into mitchell/dx-1912
mitchell-as Jul 12, 2023
de633cf
Updated after merge.
mitchell-as Jul 12, 2023
8cac31a
Added unit tests for buildscript merging.
mitchell-as Jul 12, 2023
5cecbf4
Renamed function.
mitchell-as Jul 12, 2023
6db3141
Move buildexpression merging out of runbits and into its own package.
mitchell-as Jul 13, 2023
2078b06
Moved buildscript merge routine into pull runner.
mitchell-as Jul 13, 2023
2431e89
Do not distinguish between build expression merge errors.
mitchell-as Jul 13, 2023
30db6ad
Renaming methods to compare build scripts to build expressions.
mitchell-as Jul 13, 2023
0b6c6bb
Simplify conversions and comparisons between buildscripts and buildex…
mitchell-as Jul 14, 2023
9ef3e39
Allow unmarshaling mono API operation to build plan API operation.
mitchell-as Jul 14, 2023
a2e9a48
Point the user to the buildscript file to resolve conflicts in.
mitchell-as Jul 14, 2023
ecdf7e7
Error out if there is no build script to merge.
mitchell-as Jul 14, 2023
3800905
Merge pull request #2623 from ActiveState/mitchell/dx-1912
mitchell-as Jul 14, 2023
79ad991
Added integration test for verifying headers sent to the Platform.
mitchell-as Jul 18, 2023
e6af549
Supply version string to VersionInfo after parsing.
mitchell-as Jul 18, 2023
4fa2f63
Merge branch version/0-41-0-RC1 to adopt changes from PR #2630
as-builds Jul 18, 2023
d07bfbf
Merge branch version/0-40-0-RC2 to adopt changes from PR #2637
as-builds Jul 19, 2023
12d038c
Merge branch version/0-41-0-RC1 to adopt changes from PR #2624
as-builds Jul 19, 2023
8944baa
Merge branch version/0-41-0-RC1 to adopt changes from PR #2626
as-builds Jul 19, 2023
f3504e9
Merge branch version/0-41-0-RC1 to adopt changes from PR #2643
as-builds Jul 19, 2023
1c4a4ce
Merge branch version/0-41-0-RC1 to adopt changes from PR #2642
as-builds Jul 20, 2023
d6c8549
Merge branch version/0-41-0-RC1 to adopt changes from PR #2644
as-builds Jul 20, 2023
ed9f391
Merge branch version/0-41-0-RC1 to adopt changes from PR #2638
as-builds Jul 20, 2023
8a21bd2
Merge branch version/0-41-0-RC1 to adopt changes from PR #2645
as-builds Jul 20, 2023
5e3f5e2
Merge branch version/0-41-0-RC1 to adopt changes from PR #2639
as-builds Jul 20, 2023
a91aa5d
Merge branch version/0-41-0-RC1 to adopt changes from PR #2646
as-builds Jul 20, 2023
ccf9fa8
Merge branch version/0-41-0-RC1 to adopt changes from PR #2647
as-builds Jul 21, 2023
5483b26
Merge branch version/0-41-0-RC1 to adopt changes from PR #2652
as-builds Jul 21, 2023
5cccf4d
Use debug logging and check log for Platform header verification.
mitchell-as Jul 25, 2023
dc40913
Also print URL before request headers.
mitchell-as Jul 25, 2023
a1cd5c8
Merge pull request #2636 from ActiveState/mitchell/dx-1836
Naatan Jul 25, 2023
8e790b0
Merge branch version/0-41-0-RC1 to adopt changes from PR #2653
as-builds Jul 25, 2023
9e6d6b3
Merge branch version/0-41-0-RC1 to adopt changes from PR #2650
as-builds Jul 25, 2023
28e71af
Merge branch version/0-41-0-RC1 to adopt changes from PR #2657
as-builds Jul 25, 2023
013f890
Merge branch 'version/0-41-0-RC1'
Naatan Jul 26, 2023
81315de
Merge branch version/0-41-0-RC1 to adopt changes from PR #2661
as-builds Jul 26, 2023
f283711
Merge branch version/0-41-0-RC1 to adopt changes from PR #2662
as-builds Jul 27, 2023
7d2abd8
Merge branch version/0-41-0-RC1 to adopt changes from PR #2664
as-builds Jul 27, 2023
2d2c2b5
Merge branch version/0-41-0-RC1 to adopt changes from PR #2658
as-builds Jul 27, 2023
e0a54ba
Merge remote-tracking branch 'origin/version/0-40-0-RC4' into mitchel…
mitchell-as Jul 28, 2023
6495466
Fixed merge issues.
mitchell-as Jul 28, 2023
8e2b6d2
Merge branch 'version/0-41-0-RC1' into mitchell/dx-1859
mitchell-as Jul 28, 2023
ec071c2
Updated hello example to use localcommit.
mitchell-as Jul 28, 2023
689d0d1
Merge branch version/0-41-0-RC1 to adopt changes from PR #2666
as-builds Jul 28, 2023
47ba8cd
Merge branch version/0-41-0-RC1 to adopt changes from PR #2667
as-builds Jul 28, 2023
27f51ba
Merge branch version/0-41-0-RC1 to adopt changes from PR #2669
as-builds Jul 28, 2023
a1b7f78
Create buildscripts at request time if they do not exist.
mitchell-as Jul 28, 2023
022ddbb
Construct and update buildscripts directly from projects and targets.
mitchell-as Jul 31, 2023
a12f7a7
Updated project.Project to implement setup.Targeter interface.
mitchell-as Jul 31, 2023
ab4f1ba
Updated comment.
mitchell-as Jul 31, 2023
9644d79
Merge pull request #2668 from ActiveState/mitchell/dx-1997
mitchell-as Jul 31, 2023
285f35b
Update version.txt
Jul 31, 2023
3ea49a3
Merge remote-tracking branch 'origin/version/0-42-0-RC1' into mitchel…
mitchell-as Jul 31, 2023
221ae7b
Merge branch version/0-41-0-RC1 to adopt changes from PR #2672
as-builds Aug 1, 2023
ec0e9b4
Fixed bad merge.
mitchell-as Aug 1, 2023
78d98b2
Enable buildscript pull integration test.
mitchell-as Jul 31, 2023
838f47b
Headless projects cannot have a localcommit file or buildscript.
mitchell-as Aug 1, 2023
d307bf9
Account for buildexpression lists not being ordered.
mitchell-as Aug 1, 2023
c9353ce
Attempt to fix failing integration test.
mitchell-as Aug 1, 2023
6c86501
Added direct unit tests for utility functions..
mitchell-as Aug 3, 2023
1339446
Merge branch version/0-41-0-RC1 to adopt changes from PR #2670
as-builds Aug 3, 2023
c9bb9f4
Try to ensure there is always a commit ID file when a buildscript is …
mitchell-as Aug 3, 2023
06a76b4
Merge remote-tracking branch 'origin/version/0-42-0-RC1' into mitchel…
mitchell-as Aug 3, 2023
81f49a4
Merge pull request #2582 from ActiveState/mitchell/dx-1859
mitchell-as Aug 3, 2023
4bff402
Merge branch 'version/0-41-0-RC1' into version/0-42-0-RC1
mitchell-as Aug 4, 2023
49988f2
Merge pull request #2680 from ActiveState/mitchell/merge-41-42
Naatan Aug 4, 2023
5fb1fd1
Merge branch version/0-41-0-RC1 to adopt changes from PR #2683
as-builds Aug 4, 2023
ac094b4
Merge branch version/0-41-0-RC1 to adopt changes from PR #2684
as-builds Aug 4, 2023
f4f0d9a
Merge branch version/0-41-0-RC1 to adopt changes from PR #2671
as-builds Aug 8, 2023
9af3ad0
Merge branch 'version/0-41-0-RC1' into version/0-42-0-RC1
Naatan Aug 8, 2023
aa35764
Merge branch 'version/0-41-0-RC1' into version/0-42-0-RC1
Naatan Aug 10, 2023
a96380f
Merge branch version/0-41-0-RC1 to adopt changes from PR #2696
as-builds Aug 10, 2023
55c5669
Merge branch version/0-41-0-RC1 to adopt changes from PR #2692
as-builds Aug 10, 2023
9116577
Merge branch version/0-41-0-RC1 to adopt changes from PR #2697
as-builds Aug 10, 2023
a7f9b11
Merge branch version/0-41-0-RC1 to adopt changes from PR #2699
as-builds Aug 11, 2023
f45f161
Merge branch version/0-41-0-RC1 to adopt changes from PR #2694
as-builds Aug 11, 2023
7937c5e
Support number values in buildscripts.
mitchell-as Aug 11, 2023
4222dc0
Merge branch version/0-41-0-RC1 to adopt changes from PR #2700
as-builds Aug 11, 2023
ceea5b8
Merge branch 'version/0-41-0-RC1' into version/0-42-0-RC1
mitchell-as Aug 11, 2023
e5ff671
Fixed bad merge.
mitchell-as Aug 11, 2023
d6bc461
Merge pull request #2703 from ActiveState/mitchell/dx-2076-2
Naatan Aug 11, 2023
1b8f122
Annotate float format based on PR feedback.
mitchell-as Aug 11, 2023
ad225af
Merge pull request #2701 from ActiveState/mitchell/dx-2106
mitchell-as Aug 11, 2023
59597d2
Merge branch version/0-41-0-RC1 to adopt changes from PR #2704
as-builds Aug 11, 2023
40f9e69
Merge branch version/0-41-0-RC1 to adopt changes from PR #2693
as-builds Aug 14, 2023
aa08a7a
Merge branch version/0-41-0-RC1 to adopt changes from PR #2705
as-builds Aug 14, 2023
32ca59e
Merge branch version/0-41-0-RC1 to adopt changes from PR #2706
as-builds Aug 14, 2023
131eadd
Merge branch version/0-41-0-RC1 to adopt changes from PR #2707
as-builds Aug 14, 2023
41204ec
Merge branch version/0-41-0-RC1 to adopt changes from PR #2709
as-builds Aug 17, 2023
33f7752
Merge branch version/0-41-0-RC1 to adopt changes from PR #2712
as-builds Aug 18, 2023
c288344
Merge branch version/0-41-0-RC1 to adopt changes from PR #2713
as-builds Aug 21, 2023
ddc2edb
Merge branch version/0-41-0-RC1 to adopt changes from PR #2722
as-builds Aug 22, 2023
98ea6b1
Merge branch version/0-41-0-RC1 to adopt changes from PR #2717
as-builds Aug 22, 2023
037dc36
Update build status handling
MDrakos Aug 22, 2023
cfe9c5b
Merge branch 'master' into DX-2129
MDrakos Aug 22, 2023
8b84ac7
Fix formatting
MDrakos Aug 22, 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
4 changes: 2 additions & 2 deletions cmd/state-offline-installer/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ func (r *runner) setupRuntime(artifactsPath string, targetPath string) (*runtime
offlineProgress := newOfflineProgressOutput(r.out)
eventHandler := events.NewRuntimeEventHandler(offlineProgress, nil, logfile)

rti, err := runtime.New(offlineTarget, r.analytics, nil)
rti, err := runtime.New(offlineTarget, r.analytics, nil, nil)
if err != nil {
if !runtime.IsNeedsUpdateError(err) {
return nil, errs.Wrap(err, "Could not create runtime")
}
if err = rti.Update(nil, eventHandler); err != nil {
if err = rti.Update(eventHandler); err != nil {
return nil, errs.Wrap(err, "Had an installation error")
}
}
Expand Down
1 change: 1 addition & 0 deletions cmd/state/internal/cmdtree/cmdtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func New(prime *primer.Values, args ...string) *CmdTree {
refreshCmd,
newSwitchCommand(prime),
newTestCommand(prime),
newCommitCommand(prime),
)

return &CmdTree{
Expand Down
28 changes: 28 additions & 0 deletions cmd/state/internal/cmdtree/commit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package cmdtree

import (
"github.com/ActiveState/cli/internal/captain"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/primer"
"github.com/ActiveState/cli/internal/runners/commit"
)

func newCommitCommand(prime *primer.Values) *captain.Command {
runner := commit.New(prime)

cmd := captain.NewCommand(
"commit",
locale.Tl("commit_title", "Commit Changes"),
locale.Tl("commit_description", "Commit changes to the Build Script"),
prime,
[]*captain.Flag{},
[]*captain.Argument{},
func(_ *captain.Command, _ []string) error {
return runner.Run()
},
)

cmd.SetGroup(EnvironmentSetupGroup)

return cmd
}
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/ActiveState/termtest v0.7.2
github.com/ActiveState/termtest/expect v0.7.0
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
github.com/alecthomas/participle/v2 v2.0.0
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/andygrunwald/go-jira v1.15.1
github.com/aws/aws-sdk-go v1.34.28
Expand Down Expand Up @@ -131,7 +132,7 @@ require (
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sergi/go-diff v1.3.1
github.com/src-d/gcfg v1.4.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
Expand Down
8 changes: 7 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRB
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk=
github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g=
github.com/alecthomas/participle/v2 v2.0.0/go.mod h1:rAKZdJldHu8084ojcWevWAL8KmEU+AT+Olodb+WoN2Y=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down Expand Up @@ -753,6 +757,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c h1:kp3AxgXgDOmIJFR7bIwqFhwJ2qWar8tEQSE5XXhCfVk=
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
Expand Down Expand Up @@ -949,8 +954,9 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0 h1:Xuk8ma/ibJ1fOy4Ee11vHhUFHQNpHhrBneOCNHVXS5w=
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0/go.mod h1:7AwjWCpdPhkSmNAgUv5C7EJ4AbmjEB3r047r3DXWu3Y=
github.com/shirou/gopsutil/v3 v3.22.7 h1:flKnuCMfUUrO+oAvwAd6GKZgnPzr098VA/UJ14nhJd4=
Expand Down
3 changes: 0 additions & 3 deletions internal/assets/contents/activestate.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
project: {{.Project}}
{{if and (.Private) (eq .CommitID "") }}
private: {{.Private}}
{{end}}
{{.Content}}
17 changes: 17 additions & 0 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ const ServiceCommandName = "state-svc"
// ConfigFileName holds the name of the file that the user uses to configure their project, not to be confused with InternalConfigFileNameLegacy
const ConfigFileName = "activestate.yaml"

// ProjectConfigDirName is the name of the directory that holds project-specific data like commit ID.
// This folder does not hold ConfigFileName. It is a sibling to that file in a given directory.
const ProjectConfigDirName = ".activestate"

// BuildScriptFileName holds the name of the file that represents the build script used to generate the runtime
const BuildScriptFileName = "buildscript.yaml"

// CommitIdFileName is the name of the file in ProjectConfigDirName that contains a project's commit ID.
const CommitIdFileName = "commit"

// InternalConfigNamespace holds the appdata folder name under which we store our config
const InternalConfigNamespace = "activestate"

Expand Down Expand Up @@ -366,6 +376,9 @@ const RuntimeRecipeStore = "recipe"
// RuntimeBuildPlanStore containts a serialization of the build plan used to create this build
const RuntimeBuildPlanStore = "build_plan"

// BuildExpressionStore holds the cached build expression for the current commit ID.
const BuildExpressionStore = "build_expression"

// StateToolMarketingPage links to the marketing page for the state tool
const StateToolMarketingPage = "https://www.activestate.com/products/platform/state-tool/"

Expand Down Expand Up @@ -501,3 +514,7 @@ const TerminalAnimationInterval = 150 * time.Millisecond
// RuntimeSetupWaitEnvVarName is only used for an integration test to pause installation and wait
// for Ctrl+C.
const RuntimeSetupWaitEnvVarName = "ACTIVESTATE_CLI_RUNTIME_SETUP_WAIT"

// PlatformApiRequestRequestsEnvVarName is only used for an integration test to print some Platform
// API request info.
const PlatformApiPrintRequestsEnvVarName = "ACTIVESTATE_CLI_PLATFORM_API_PRINT_REQUESTS"
20 changes: 11 additions & 9 deletions internal/constraints/constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package constraints
import (
"bytes"
"fmt"
"path/filepath"
"regexp"
"sort"
"strings"
"text/template"

"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/logging"
"github.com/ActiveState/cli/internal/multilog"
"github.com/ActiveState/cli/internal/rtutils/ptr"
"github.com/ActiveState/cli/pkg/localcommit"
"github.com/ActiveState/cli/pkg/platform/authentication"
"github.com/ActiveState/cli/pkg/projectfile"
"github.com/ActiveState/cli/pkg/sysinfo"
Expand Down Expand Up @@ -76,9 +77,9 @@ type projectable interface {
Owner() string
Name() string
NamespaceString() string
CommitID() string
BranchName() string
Path() string
Dir() string
URL() string
}

Expand All @@ -90,19 +91,20 @@ func NewPrimeConditional(auth *authentication.Auth, pj projectable, subshellName
pjURL string
pjCommit string
pjBranch string
pjPath string
pjDir string
)
if !ptr.IsNil(pj) {
pjOwner = pj.Owner()
pjName = pj.Name()
pjNamespace = pj.NamespaceString()
pjURL = pj.URL()
pjCommit = pj.CommitID()
pjBranch = pj.BranchName()
pjPath = pj.Path()
if pjPath != "" {
pjPath = filepath.Dir(pjPath)
commitID, err := localcommit.Get(pj.Dir())
if err != nil && !localcommit.IsFileDoesNotExistError(err) {
multilog.Error("Unable to get local commit: %v", errs.JoinMessage(err))
}
pjCommit = commitID.String()
pjBranch = pj.BranchName()
pjDir = pj.Dir()
}

c := NewConditional(auth)
Expand All @@ -113,7 +115,7 @@ func NewPrimeConditional(auth *authentication.Auth, pj projectable, subshellName
"Url": pjURL,
"Commit": pjCommit,
"Branch": pjBranch,
"Path": pjPath,
"Path": pjDir,

// Legacy
"NamespacePrefix": pjNamespace,
Expand Down
2 changes: 1 addition & 1 deletion internal/constraints/testdata/activestate.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
project: https://platform.activestate.com/constraints-tests/ActiveState?branch=main&commitID=00010001-0001-0001-0001-000100010001
project: https://platform.activestate.com/constraints-tests/ActiveState?branch=main
environments: "itworks"
21 changes: 17 additions & 4 deletions internal/locale/locales/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,6 @@ secrets_row_value_unset:
other: "[ERROR]× Not defined[/RESET]"
secrets_description_unset:
other: "[DISABLED]Not provided.[/RESET]"
pull_not_updated:
other: Your activestate.yaml is already up to date!
pull_updated:
other: Your project in the activestate.yaml has been updated to {{.V0}}@{{.V1}}.
keypair_cmd_description:
Expand Down Expand Up @@ -1222,6 +1220,12 @@ package_update_config_file:
other: To ensure your local project is synchronized with the ActiveState platform please use [ACTIONABLE]`state pull`[/RESET]
inventory_ingredient_not_available:
other: The package '[NOTICE]{{.V0}}[/RESET]' is not available on the ActiveState Platform, or does not have a matching version
err_update_build_script:
other: Could not update runtime build script
notice_commit_build_script:
other: |
Your local build script has changes that should be committed. Please run [ACTIONABLE]`state commit`[/RESET] to do so.

command_flag_invalid_value:
other: "Invalid value for {{.V0}} flag: [NOTICE]{{.V1}}[/RESET]"
err_cmdtree:
Expand Down Expand Up @@ -1679,8 +1683,8 @@ artifact_succeeded:
other: "Completed: [NOTICE]{{.V0}} ({{.V1}}/{{.V2}})[/RESET]"
artifact_failed:
other: "Failed: [NOTICE]{{.V0}}[/RESET]. Error returned: [ERROR]{{.V1}}[/RESET]"
err_package_update_pjfile:
other: "Could not update your activestate.yaml with the new commit ID. Please run [ACTIONABLE]`state pull`[/RESET] manually."
err_package_update_commit_id:
other: "Could not update your project runtime's commit ID. Please run [ACTIONABLE]`state pull`[/RESET] manually."
prepare_protocol_warning:
other: Could not add state protocol
err_preparestart_shortcut:
Expand Down Expand Up @@ -2076,6 +2080,15 @@ err_init_authenticated:
other: You need to be authenticated to initialize a project. Authenticate by running [ACTIONABLE]`state auth`[/RESET].
err_country_blocked:
other: This service is not available in your region.
err_commit_id_invalid:
other: "Invalid project commit ID: {{.V0}}"
commit_id_gitignore:
other: |
# Ignore {{.V0}}/{{.V1}} file; tracking this via VCS will cause users to have to resolve redundant conflicts
{{.V0}}/{{.V1}}
notice_commit_id_gitignore:
other: |
The State Tool created an [ACTIONABLE]{{.V0}}/{{.V1}}[/RESET] file with your project's commit ID, but it was unable to add it to your [ACTIONABLE].gitignore[/RESET] file. Please add it manually.
err_shortcutdir_writable:
other: Could not continue as we don't have permission to create [ACTIONABLE]{{.V0}}[/RESET].
err_edit_local_checkouts:
Expand Down
Loading