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

Remove headless #2835

Merged
merged 12 commits into from
Oct 31, 2023
Merged

Remove headless #2835

merged 12 commits into from
Oct 31, 2023

Conversation

MDrakos
Copy link
Member

@MDrakos MDrakos commented Oct 19, 2023

TaskDX-2224 Remove headless commits

@github-actions github-actions bot changed the base branch from master to version/0-42-0-RC1 October 19, 2023 20:39
@MDrakos
Copy link
Member Author

MDrakos commented Oct 25, 2023

I've fixed the test failures that I introduced. Any further failures should be unrelated to this PR.

Copy link
Contributor

@mitchell-as mitchell-as left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good overall. Just a few minor things to address.

@@ -316,6 +313,7 @@ const ActiveStateSupportURL = "https://www.activestate.com/support/?utm_source=p
const ActiveStateDashboardURL = "https://platform.activestate.com/?utm_source=platform-application-gui&utm_medium=activestate-desktop&utm_content=drop-down&utm_campaign=maru"

// DashboardCommitURL is the URL used to inspect commits
// TODO: Can this be removed?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry this TODO will get lost unless we address it now or file a story to investigate. A quick search yields this being used by pkg/platform/model/project.go's CommitURL() function, but that function does not appear to be called by anything. Perhaps remove this along with that function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, I meant to look into this before I opened a PR. You're right, looks like it can be removed.

internal/locale/locales/en-us.yaml Show resolved Hide resolved
internal/runbits/requirements/requirements.go Outdated Show resolved Hide resolved
rtTarget = target.NewCustomTarget("", "", "", params.Path, trigger, true)
} else {
rtTarget = target.NewProjectTarget(proj, nil, trigger)
return locale.WrapInputError(err, "exec_no_project_at_path", "Could not find project file at {{.V0}}", projectDir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ultimately a runtime issue? If so, does rationalize/types.go's ErrNoProject apply here too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to opt to leave this one here for now. I think it is a candidate for ErrNoProject but this error is surfaced specifically when a user provides the project path to the command. When it comes time for this command to support user-facing errors we can enrich ErrNoProject like the localization is doing currently.

@@ -90,7 +89,6 @@ func New(target setup.Targeter, an analytics.Dispatcher, svcm *model.SvcModel, a
recordAttempt(an, target)
an.Event(anaConsts.CatRuntimeDebug, anaConsts.ActRuntimeStart, &dimensions.Values{
Trigger: ptr.To(target.Trigger().String()),
Headless: ptr.To(strconv.FormatBool(target.Headless())),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking out loud: do we want to deprecate this dimension? We've done so in the past for other dimensions, but I don't know exactly what that entails.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've deprecated events in the past but I'm not sure about dimensions... I'll see what I can find. We want to keep the dimension around for now as there may be headless projects out in the wild.

Copy link
Contributor

@mitchell-as mitchell-as left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few more things upon further review.

internal/runbits/rationalize/types.go Outdated Show resolved Hide resolved
@@ -221,6 +221,13 @@ func (suite *BundleIntegrationTestSuite) TestJSON() {
cp.ExpectExitCode(0)
AssertValidJSON(suite.T(), cp)

cp = ts.SpawnWithOpts(
e2e.OptArgs("checkout", "ActiveState-CLI/Bundles", "."),
e2e.OptAppendEnv("ACTIVESTATE_CLI_DISABLE_RUNTIME=false"),
Copy link
Contributor

@mitchell-as mitchell-as Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we don't need to source the runtime here, as we're sourcing it in the next command. I think we can safely remove this line to cut down on execution time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me give it another shot. When I had this line disabled I was running into issues with the tests failing.

@@ -501,6 +470,13 @@ func (suite *PackageIntegrationTestSuite) TestJSON() {
cp.ExpectExitCode(0)
AssertValidJSON(suite.T(), cp)

cp = ts.SpawnWithOpts(
e2e.OptArgs("checkout", "ActiveState-CLI/Packages-Perl", "."),
e2e.OptAppendEnv("ACTIVESTATE_CLI_DISABLE_RUNTIME=false"),
Copy link
Contributor

@mitchell-as mitchell-as Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this line because the runtime is being sourced in the next operation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this line causes the tests to panic.

Removed unreferenced code
Use rationalized error type
Attempt to speed up integration tests
@MDrakos MDrakos merged commit c3faef4 into version/0-42-0-RC1 Oct 31, 2023
5 of 7 checks passed
@MDrakos MDrakos deleted the DX-2224 branch October 31, 2023 17:21
@MDrakos MDrakos mentioned this pull request Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants