-
Notifications
You must be signed in to change notification settings - Fork 24
feat: display manifest source in human-friendly format #90
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
31559f0
feat: display manifest source in human-readable format
mwbrooks 5c27011
test: fix failing tests
mwbrooks acd2a00
Update cmd/app/link.go
mwbrooks 3913b13
feat: handle unknown manifest source
mwbrooks 4eaea06
feat: quote the human-friendly name
mwbrooks 9329993
Merge branch 'main' into mwbrooks-manifest-source-human
mwbrooks 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -84,11 +84,11 @@ func Test_Config_ManifestSource_String(t *testing.T) { | |
| a ManifestSource | ||
| expected string | ||
| }{ | ||
| "project manifest source is local": { | ||
| "local manifest source": { | ||
| a: ManifestSourceLocal, | ||
| expected: "local", | ||
| }, | ||
| "remote manifest source is remote": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🪓 🪓 |
||
| "remote manifest source": { | ||
| a: ManifestSourceRemote, | ||
| expected: "remote", | ||
| }, | ||
|
|
@@ -100,3 +100,29 @@ func Test_Config_ManifestSource_String(t *testing.T) { | |
| }) | ||
| } | ||
| } | ||
|
|
||
| func Test_Config_ManifestSource_Human(t *testing.T) { | ||
| tests := map[string]struct { | ||
| a ManifestSource | ||
| expected string | ||
| }{ | ||
| "local manifest source is the project (local)": { | ||
| a: ManifestSourceLocal, | ||
| expected: `"project" (local)`, | ||
| }, | ||
| "remote manifest source is app settings (remote)": { | ||
| a: ManifestSourceRemote, | ||
| expected: `"app settings" (remote)`, | ||
| }, | ||
| "unknown manifest source uses String()": { | ||
| a: "unknown", | ||
| expected: "unknown", | ||
| }, | ||
| } | ||
| for name, tt := range tests { | ||
| t.Run(name, func(t *testing.T) { | ||
| actual := tt.a.Human() | ||
| assert.Equal(t, tt.expected, actual) | ||
| }) | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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
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.
📚 This might not be a good suggestion, but confusion could arise with when these updates are.
Perhaps this is alright though! Another command might make this difference more obvious in later iteration?
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.
Edit: This comment makes me think "on update" is better wording, but again no blocker!
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.
I agree that this can be confusing. Unfortunately, the project-level manifest is used in many places and not just updates/re-installs. For example,
slack manifest validatebut also many areas of the internal-workings such as checking whether the app is hosted or not (a pre-run for some commands).Looking ahead, this warning is probably going to be removed or reduced to a single line such as:
So, we probably don't need to overthink the current warning too much.
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.
@mwbrooks 🧠 ✨ Of course, how could I forget!
I will celebrate this learning with good a fortune 👾