-
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
Conversation
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.
Quick notes to explain some of my edits ✏️
cmd/app/link.go
Outdated
| fmt.Sprintf(`App manifest source can be "%s" or "%s":`, config.ManifestSourceLocal.Human(), config.ManifestSourceRemote.Human()), | ||
| fmt.Sprintf("- %s: uses manifest from your project's source code for all apps", config.ManifestSourceLocal.String()), | ||
| fmt.Sprintf("- %s: uses manifest from app settings for each app", config.ManifestSourceRemote.String()), | ||
| " ", | ||
| fmt.Sprintf(style.Highlight(`Your manifest source is "%s"`), manifestSource.Human()), | ||
| " ", |
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.
note: I tweaked the wording now that we've had some time to reflect on this. Once we default Bolt projects to remote manifest, this warning will no longer be shown, so it's not a long-lived change.
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 section has been confusing to me before, but I hadn't realized that a defaulted remote manifest source will avoid this altogether!
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: For my own understanding, will it still be shown but instead much less often?
I can imagine changing the manifest source to local for automated productions then linking an app later, though this might not be the common case...
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.
Good question! I think the warning becomes less common after bolt-install and we could consider changing it to a message instead of a prompt.
The warning should be displayed when a project manages the app manifest (manifest.source: "local") and an existing app is linked (slack app link).
Right now, the warning prompts you to switch to a remote manifest source. I think we have an opportunity to make this more flexible. There are some cases where you may want to link an app while keeping your local manifest source.
Long story short, we'll want to think more about this as we make decisions around bolt-install 😆
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #90 +/- ##
==========================================
+ Coverage 63.17% 63.18% +0.01%
==========================================
Files 210 210
Lines 22186 22194 +8
==========================================
+ Hits 14015 14023 +8
Misses 7084 7084
Partials 1087 1087 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
left a comment
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 I started to ramble out of excitement for this change. It's so helpful in understanding what "remote" and "local" mean while still keeping these terms for actual configuration 🤩
Most of the comments that follow focus on sentence structure and formatting, but it seems aligned with the goals of this PR I hope 📚 ✨
Outside of a fallback default case with perhaps a test, nothing is blocking so this gets an approve but I am hoping to hear more of what you're thinking about these changes. I'm also looking forward to follow ups in copy, so no worries if some comments are ignored 🐏
| a: ManifestSourceLocal, | ||
| expected: "local", | ||
| }, | ||
| "remote manifest source is remote": { |
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.
🪓 🪓
cmd/app/link.go
Outdated
| fmt.Sprintf(`App manifest source can be "%s" or "%s":`, config.ManifestSourceLocal.Human(), config.ManifestSourceRemote.Human()), | ||
| fmt.Sprintf("- %s: uses manifest from your project's source code for all apps", config.ManifestSourceLocal.String()), | ||
| fmt.Sprintf("- %s: uses manifest from app settings for each app", config.ManifestSourceRemote.String()), | ||
| " ", | ||
| fmt.Sprintf(style.Highlight(`Your manifest source is "%s"`), manifestSource.Human()), | ||
| " ", |
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 section has been confusing to me before, but I hadn't realized that a defaulted remote manifest source will avoid this altogether!
internal/config/manifest.go
Outdated
| func (ms ManifestSource) Human() string { | ||
| switch ms { | ||
| case ManifestSourceLocal: | ||
| return fmt.Sprintf("project (%s)", ms.String()) |
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 be confusing, but I have a small favor towards quoting "project" while keeping (local) and (remote) in parentheses.
To me it'd read better in lines like:
App manifest source can be "project" (local) or "app settings" (remote)
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: But perhaps we remove quotes in these lines altogether? Or handle the cases of "project" and "app settings" in configuration, but with warning to use the preferred local or remote?
I now lean towards removing quotes, but I'd love to know what is most clear to you!
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.
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.
Commit 4eaea06 now quotes the human-friendly name and wraps the ID in parentheses.
internal/config/manifest.go
Outdated
| case ManifestSourceRemote: | ||
| return fmt.Sprintf("app settings (%s)", ms.String()) | ||
| } | ||
| return "" |
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.
| return "" | |
| return ms.String() |
Ought not we find a confusing blank output here in some strange case 😉
Edit: A test for this too would be superb but is also no blocker for me 🤖 ✨
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.
Great eye! Commit 3913b13 handles unknown manifest sources with your suggestion above and adds a test case 👌🏻
cmd/app/link.go
Outdated
| fmt.Sprintf("managed by %s.", config.ManifestSourceRemote.Human()), | ||
| " ", | ||
| fmt.Sprintf(style.Highlight(`Your manifest source is "%s"`), manifestSource.String()), | ||
| fmt.Sprintf(`App manifest source can be "%s" or "%s":`, config.ManifestSourceLocal.Human(), config.ManifestSourceRemote.Human()), |
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.
🗣️ Another comment suggests removing the quotations with Human but I'd be curious how this reads.
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 think for this specific line, we want to tell the developer what their current manifest source is set to. I stuck with the .String() but we could switch it to the .Human().
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.
cmd/app/link.go
Outdated
| fmt.Sprintf(`App manifest source can be "%s" or "%s":`, config.ManifestSourceLocal.Human(), config.ManifestSourceRemote.Human()), | ||
| fmt.Sprintf("- %s: uses manifest from your project's source code for all apps", config.ManifestSourceLocal.String()), | ||
| fmt.Sprintf("- %s: uses manifest from app settings for each app", config.ManifestSourceRemote.String()), | ||
| " ", | ||
| fmt.Sprintf(style.Highlight(`Your manifest source is "%s"`), manifestSource.Human()), | ||
| " ", |
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: For my own understanding, will it still be shown but instead much less often?
I can imagine changing the manifest source to local for automated productions then linking an app later, though this might not be the common case...
| " ", | ||
| fmt.Sprintf(style.Highlight(`Your manifest source is "%s"`), manifestSource.String()), | ||
| fmt.Sprintf(`App manifest source can be "%s" or "%s":`, config.ManifestSourceLocal.Human(), config.ManifestSourceRemote.Human()), | ||
| fmt.Sprintf("- %s: uses manifest from your project's source code for all apps", config.ManifestSourceLocal.String()), |
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.
| fmt.Sprintf("- %s: uses manifest from your project's source code for all apps", config.ManifestSourceLocal.String()), | |
| fmt.Sprintf("- %s: uses manifest from your project's source code on reinstallation", config.ManifestSourceLocal.String()), |
📚 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?
$ slack manifest updateThere 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!
| fmt.Sprintf("- %s: uses manifest from your project's source code for all apps", config.ManifestSourceLocal.String()), | |
| fmt.Sprintf("- %s: uses manifest from your project's source code on update", config.ManifestSourceLocal.String()), |
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 validate but 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:
🤖 Some Title
Reading app manifest from app settings
Reading app manifest from projectSo, 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!
Unfortunately, the project-level manifest is used in many places
I will celebrate this learning with good a fortune 👾



CHANGELOG
Summary
This pull request updates the
type ManifestSourcewith amanifestSource.Human()method to display human-friendly strings during output.The string format is
noun (id):project (local)app settings (remote)Since we often need to output the manifest source, the
localandremoteIDs make the developer think a lot. I feel that we can be a good host by displaying these IDs in a more applicable way.Preview
slack initorslack createslack app link <id>Reviewer
Requirements