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

FEDX-812 Improve CLI ergonomics #6

Merged
merged 3 commits into from
Jun 13, 2024

Conversation

evanweible-wf
Copy link
Contributor

Motivation

Currently, in order to "override" the command that gets run when using dpx, you have to specify the package source by adding -p and then changing via the first arg, whereas otherwise the -p arg is not required and is inferred from the first arg.

So for example:

# This runs the default executable from `my_tool`
dpx [email protected]:my_tool

# To override that and run a different executable, you need
# to explicitly specify the package source with `-p`:
dpx -p [email protected]:my_tool other_exe

This is awkward because it's not obvious when the -p format should be used.

Changes

A few changes are made in this PR to improve the overall ergonomics of the CLI:

  • Always require that the first position arg is a package spec
  • Always run via dart pub global run by default
  • Allow package-executable to be set explicitly with a trailing :<exe> on the package spec
  • Add -e <executable> option to override the executable that gets run, allowing a way to opt out of the dart pub global run approach.

@rmconsole-wf
Copy link

rmconsole-wf commented Jun 3, 2024

Merge Requirements Met ✅

Request Rosie to automerge this pull request by including @Workiva/release-management-p in a comment.

✅ Required actions successful
(Workflow job Dart build has conclusion: success)
(Workflow job Dart checks - 2.19.6 on ubuntu has conclusion: success)
(Workflow job Dart checks - stable on ubuntu has conclusion: success)
(Workflow job Dart checks - 2.19.6 on windows has conclusion: success)
(Workflow job Dart checks - stable on windows has conclusion: success)

General Information

Ticket(s):

Code Review(s): #6

Reviewers: evanweible-wf, matthewnitschke-wk

Additional Information

Watchlist Notifications: None

	When this pull is merged I will add it to the following release:
	Current version: dpx 0.1.0
	Version after merge: dpx 0.1.0
	Release Ticket(s): None

Note: This is a shortened report. Click here to view Rosie's full evaluation.
Last updated on Thursday, June 13 01:04 PM CST

@evanweible-wf evanweible-wf changed the title Improve CLI ergonomics FEDX-812 Improve CLI ergonomics Jun 3, 2024
@aviary-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

- Always require that the first position arg is a package spec
- Always run via `dart pub global run` by default
- Allow package-executable to be set explicitly with a trailing `:<exe>` on the package spec
- Add `-e <executable>` option to override the executable that gets run, allowing a way to opt out of the `dart pub global run` approach.
@evanweible-wf evanweible-wf force-pushed the improve-CLI-for-overriding-command branch from 64bc890 to 42b8e97 Compare June 3, 2024 16:55
```bash
dart pub global activate -sgit [email protected]:Workiva/dpx.git
dart pub global activate dpx
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look like dpx is on the public pub server yet

Is this change just in preparation for this to happen soon? or should we add --hosted-url on this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was planning to open source and publish once this change lands 👍

@evanweible-wf
Copy link
Contributor Author

QA +1

  • CI passes
  • Manually verified each of the commands in the Readme

@evanweible-wf
Copy link
Contributor Author

@Workiva/release-management-p

@rmconsole-wf
Copy link

@evanweible-wf I will not merge this because:

  • dependencies not scanned

@chrisgustavsen-wf
Copy link

RM +1

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@rmconsole-wf
Copy link

Could not merge pull request. For assistance, reach out to a member of Release Management in the '#support-release' Slack channel

Error: 5 of 7 required status checks are expected.

1 similar comment
@rmconsole-wf
Copy link

Could not merge pull request. For assistance, reach out to a member of Release Management in the '#support-release' Slack channel

Error: 5 of 7 required status checks are expected.

@rmconsole2-wf rmconsole2-wf merged commit 120c6ae into master Jun 13, 2024
15 checks passed
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.

6 participants