-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add separate checkout info block to buildscripts. #3483
Open
mitchell-as
wants to merge
18
commits into
version/0-47-0-RC1
Choose a base branch
from
mitchell/dx-3024
base: version/0-47-0-RC1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2081db6
Participle should unquote strings.
mitchell-as 5033503
Initial support for commit info in buildscript.
mitchell-as 72cb762
Fetching buildscripts should also populate the Project commit info.
mitchell-as ec39083
localcommit package should update buildscript's Project commit info.
mitchell-as 5b403b6
Rename "commit info" to "checkout info" in recent changes.
mitchell-as 41ee7a1
Rename localcommit package to checkoutinfo.
mitchell-as e504147
Fixed failing unit tests.
mitchell-as a2e043d
Add warning about using an outdated buildscript.
mitchell-as e036299
Sort artifact changesets by name.
mitchell-as 1bbf6c2
Revert "Sort artifact changesets by name."
mitchell-as 008161f
Pass project details to the buildscript runbit, not project objects.
mitchell-as 4a91dda
Include branch in buildscript commit info.
mitchell-as ccd9554
Use YAML parser when unmarshaling buildscript checkout info.
mitchell-as b1bb954
Update activestate.yaml with any buildscript checkout info changes.
mitchell-as 9bcce03
Make build scripts first-class citizens.
mitchell-as a54541d
Fix some failing tests.
mitchell-as 6b174f8
Make checkoutinfo a primer property and use it to set commit IDs, and…
mitchell-as 4a150c0
Moved `buildscript_runbit.ScriptFromProject()` into `checkoutinfo.Bui…
mitchell-as File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package buildscript_runbit | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/go-openapi/strfmt" | ||
|
||
"github.com/ActiveState/cli/internal/constants" | ||
"github.com/ActiveState/cli/internal/errs" | ||
"github.com/ActiveState/cli/pkg/buildscript" | ||
"github.com/ActiveState/cli/pkg/checkoutinfo" | ||
) | ||
|
||
func CommitID(path string, cfg configurer) (strfmt.UUID, error) { | ||
script, err := buildscript.New() | ||
if err != nil { | ||
return "", errs.Wrap(err, "Could not create build script") | ||
} | ||
|
||
project, err := checkoutinfo.GetProject(path) | ||
if err != nil { | ||
return "", errs.Wrap(err, "Could not get project") | ||
} | ||
script.SetProjectURL(project) // script.CommitID() is extracted from project URL | ||
|
||
if cfg.GetBool(constants.OptinBuildscriptsConfig) { | ||
if script2, err := ScriptFromProject(path); err == nil { | ||
script = script2 | ||
} else if !errors.Is(err, ErrBuildscriptNotExist) { | ||
return "", errs.Wrap(err, "Could not get build script") | ||
} | ||
// ErrBuildscriptNotExist will fall back on activestate.yaml | ||
} | ||
|
||
return script.CommitID() | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to checkoutinfo? I get where you're coming from, but runbits are about sharing controller logic. This isn't controller logic. And this type of muliplexing is exactly what the checkoutinfo package is intended for.