Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Aug 13, 2025

Changelog

All available samples can be listed with the slack samples --list command. The --language flag might be found useful in filtering these outputs.

Summary

This PR adds a --list flag to the samples command.

Preview

📸

samples

Reviewers

The following filters might be useful in experimentation! 🦠

$ slack samples --list
$ slack samples --list --language deno
$ slack samples --list --language java
$ slack samples --list --language node
$ slack samples --list --language bolt-js
$ slack samples --list --language bolt-ts
$ slack samples --list --language python
$ slack samples --list --language go

Requirements

@zimeg zimeg added this to the Next Release milestone Aug 13, 2025
@zimeg zimeg self-assigned this Aug 13, 2025
@zimeg zimeg added the enhancement M-T: A feature request for new functionality label Aug 13, 2025
@zimeg zimeg requested a review from a team as a code owner August 13, 2025 08:24
@zimeg zimeg added changelog Use on updates to be included in the release notes semver:minor Use on pull requests to describe the release version increment area:deno-sdk Related to github.com/slackapi/deno-slack-sdk area:bolt-js Related to github.com/slackapi/bolt-js area:bolt-python Related to github.com/slackapi/bolt-python labels Aug 13, 2025
@codecov
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 70.52632% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.00%. Comparing base (c85c86c) to head (d2e22de).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/project/samples.go 81.25% 8 Missing and 4 partials ⚠️
cmd/project/create_samples.go 57.69% 11 Missing ⚠️
cmd/project/create_template.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #192      +/-   ##
==========================================
+ Coverage   62.95%   63.00%   +0.05%     
==========================================
  Files         212      212              
  Lines       21782    21848      +66     
==========================================
+ Hits        13713    13766      +53     
- Misses       7006     7018      +12     
- Partials     1063     1064       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

🌚 Quick notes for amazing reviewers follow!

if err != nil {
return err
}
if samplesListFlag || !clients.IO.IsTTY() {
Copy link
Member Author

Choose a reason for hiding this comment

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

👁️‍🗨️ note: We avoid attempting prompts in a non-interactive environment and instead list samples!

🗣️ note: The changes of #193 make this behavior more clear IMO since flag substitutes will then have matching prompts or the create command should be used.

@zimeg zimeg modified the milestones: v3.6.1, Next Release Aug 22, 2025
@zimeg zimeg requested a review from kkemple August 23, 2025 00:13
Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

📝 Nice feature! I personally enjoy the flat list more than the interactive one.

❓ Curious where this feature idea came from?

🧪 While testing, I noticed that the order isn't sorted on my side. Is that happening on your side too? Also, I left a suggestion to remove the emojis since they don't have a strong meaning.

// listSampleSelection outputs available samples matching a language flag filter
func listSampleSelection(ctx context.Context, clients *shared.ClientFactory, sampleRepos []create.GithubRepo) error {
filteredRepos := filterRepos(sampleRepos, samplesLanguageFlag)
sortedRepos := sortRepos(filteredRepos)
Copy link
Member

Choose a reason for hiding this comment

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

question: Are you noticing that the repos aren't sorted?

Image

Copy link
Member Author

Choose a reason for hiding this comment

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

@mwbrooks This confused me too but these might find order from the stars? ⭐

I wonder if showing the number of stars would be helpful? I might expect this to prefix the sample, but am not sure at all if that'd be right:

⭐ 60 - deno-timesheet-approval
   Collect timesheet information from users and store it in a Google Sheet
   https://github.com/slack-samples/deno-timesheet-approval

Comment on lines 126 to 131
emojis := []string{
"microscope",
"test_tube",
"petri_dish",
"dna",
}
Copy link
Member

Choose a reason for hiding this comment

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

thought: While the emojis are a nice touch, I found them a little confusing. I spent some time trying to understand the meaning behind the emoji. I think it would be better to not include the emojis.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mwbrooks Oops! Returning to this now! It's confusing without obvious meaning... I agree! This was changed to use different emojis in da1d105 that separate "template" apps from "example" samples:

samples

I'm curious what no emojis would look like though? I found this "column" ordering to be perhaps confusing in context with long lines. Perhaps we revisit app descriptions later? Or change these outputs elsewise?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for taking the time to look back into this! Since the samples command has low usage, I think we can start by including the lengthy descriptions and revisit it later.

@zimeg zimeg modified the milestones: v3.7.0, Next Release Sep 5, 2025
@zimeg zimeg requested a review from mwbrooks September 17, 2025 05:51
@zimeg
Copy link
Member Author

zimeg commented Sep 17, 2025

❓ Curious where this feature idea came from?

@mwbrooks Thanks for reviewing and sharing suggestions alike! I made some updates in above commits and comments that reorder outputs to make things more clear I hope.

I was hoping for a quick filter of current samples for similar outputs as the pages of docs.slack.dev/samples 🤖

Although I notice now we filter moreso by runtime without a "sample" and "template" option. I think this is alright to continue with but am open to all suggestion! Will rerequest a kind review! 🙏 ✨

Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

I'm curious what no emojis would look like though?

Personally, I'd lean toward no emojis. I think the nuances between examples and templates is difficult to understand. They're all sample apps and the more important filter is the framework language.

My two cents is to remove the emojis all together or use the same emoji for all samples.

✅ Tossing an approval on this one. Overall, it's moving the samples command in a better direction. Thanks @zimeg!

@zimeg
Copy link
Member Author

zimeg commented Sep 19, 2025

@mwbrooks Once again, thanks for the kind review 🙏 ✨

My two cents is to remove the emojis all together or use the same emoji for all samples.

As a fast change to use one emoji I put together d2e22de but I'm hoping we can revisit outputs in future iteration 👾

Let's merge this now with follow up later! 🚢

@zimeg zimeg merged commit 1d23e94 into main Sep 19, 2025
6 checks passed
@zimeg zimeg deleted the zimeg-feat-samples-list branch September 19, 2025 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bolt-js Related to github.com/slackapi/bolt-js area:bolt-python Related to github.com/slackapi/bolt-python area:deno-sdk Related to github.com/slackapi/deno-slack-sdk changelog Use on updates to be included in the release notes enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants