Skip to content

feat: output a list of samples for a language with the samples command - #192

Merged
zimeg merged 8 commits into
mainfrom
zimeg-feat-samples-list
Sep 19, 2025
Merged

feat: output a list of samples for a language with the samples command#192
zimeg merged 8 commits into
mainfrom
zimeg-feat-samples-list

Conversation

@zimeg

@zimegzimeg commented Aug 13, 2025

Copy link
Copy Markdown
Member

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

@zimegzimeg added this to the Next Release milestone Aug 13, 2025
@zimegzimeg self-assigned this Aug 13, 2025
@zimegzimeg 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 ownerAugust 13, 2025 08:24
@zimegzimeg 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

codecovBot commented Aug 13, 2025

Copy link
Copy Markdown

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 linesPatch %Lines
cmd/project/samples.go81.25%8 Missing and 4 partials ⚠️
cmd/project/create_samples.go57.69%11 Missing ⚠️
cmd/project/create_template.go0.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.

@zimegzimeg left a comment

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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.

@zimegzimeg modified the milestones: v3.6.1, Next ReleaseAug 22, 2025
@zimeg
zimeg requested a review from kkempleAugust 23, 2025 00:13

@mwbrooksmwbrooks left a comment

Copy link
Copy Markdown
Member

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.

Comment threadcmd/project/samples.go Outdated
// 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
Copy Markdown
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
Copy Markdown
MemberAuthor

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 threadcmd/project/samples.go Outdated
Comment on lines +126 to +131
emojis := []string{
"microscope",
"test_tube",
"petri_dish",
"dna",
}

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
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.

@zimegzimeg modified the milestones: v3.7.0, Next ReleaseSep 5, 2025
@zimeg
zimeg requested a review from mwbrooksSeptember 17, 2025 05:51
@zimeg

Copy link
Copy Markdown
MemberAuthor

❓ 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! 🙏 ✨

@mwbrooksmwbrooks left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

@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 mainSep 19, 2025
6 checks passed
@zimeg
zimeg deleted the zimeg-feat-samples-list branch September 19, 2025 21:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bolt-jsRelated to github.com/slackapi/bolt-jsarea:bolt-pythonRelated to github.com/slackapi/bolt-pythonarea:deno-sdkRelated to github.com/slackapi/deno-slack-sdkchangelogUse on updates to be included in the release notesenhancementM-T: A feature request for new functionalitysemver:minorUse on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@zimeg@mwbrooks