Skip to content

refactor: remove logger from install command#367

Open
mwbrooks wants to merge 2 commits intomainfrom
mwbrooks-chopping-the-log-3
Open

refactor: remove logger from install command#367
mwbrooks wants to merge 2 commits intomainfrom
mwbrooks-chopping-the-log-3

Conversation

@mwbrooks
Copy link
Member

@mwbrooks mwbrooks commented Mar 6, 2026

Changelog

  • N/A

Summary

This pull request is part 3 of removing internal/logger package and is focused on the the install command.

  • Impacts Deno deployed installations
  • Impacts Bolt or local installations

Test Steps

# Create an app
$ lack create my-app -t https://github.com/slack-samples/deno-starter-template
$ cd my-app/

# TEST: Deploy
$ lack deploy
# → Confirm no unexpected newlines or spacing issues
# → Note: Trigger creation has a double newline in production

# TEST: Re-Deploy
$ lack deploy
# → Confirm no unexpected newlines or spacing issues
# → Note: Trigger creation has a double newline in production
# → Note: Manifest warning home_team_only has a double newline in production

# TEST: Run
$ lack run
# → Confirm no unexpected newlines or spacing issues

# TEST: Re-Run
$ lack run
# → Confirm no unexpected newlines or spacing issues
# → Note: Manifest warning home_team_only has a double newline in production

# Cleanup
$ lack delete -f
$ lack delete -f
$ cd ../
$ rm -rf my-app/

Requirements

@mwbrooks mwbrooks added this to the Next Release milestone Mar 6, 2026
@mwbrooks mwbrooks self-assigned this Mar 6, 2026
@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels Mar 6, 2026
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 81.96721% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.11%. Comparing base (c449532) to head (2d3de52).

Files with missing lines Patch % Lines
internal/pkg/apps/add.go 0.00% 7 Missing ⚠️
internal/pkg/apps/install.go 95.83% 2 Missing ⚠️
internal/pkg/platform/localserver.go 0.00% 1 Missing ⚠️
internal/pkg/platform/run.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #367      +/-   ##
==========================================
+ Coverage   65.06%   65.11%   +0.04%     
==========================================
  Files         215      215              
  Lines       18179    18144      -35     
==========================================
- Hits        11829    11815      -14     
+ Misses       5254     5235      -19     
+ Partials     1096     1094       -2     

☔ 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

@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.

Comments for the reviewers eyes

switch event.Name {
case "app_install_manifest":
// Ignore this event and format manifest outputs in create/update events
case "app_install_manifest_create":
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: You can search for any of the following event names to see that the output is now display where the event was previous broadcast:

  • app_install_manifest_create
  • app_install_manifest_update
  • app_install_start
  • app_install_icon_success
  • app_install_icon_error
  • app_install_complete

}
log.Data["teamName"] = *authSession.TeamName

log.Info("on_apps_add_init")
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: This event name was broadcast but never subscribed anywhere 🤦🏻

}

// addAppLocally will add the app to the project's apps file with an empty AppID, TeamID, etc
func addAppLocally(ctx context.Context, clients *shared.ClientFactory, log *logger.Logger, app types.App) (types.App, error) {
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: diff doesn't show that log *logger.Logger was removed.


// addAppLocally will add the app to the project's apps file with an empty AppID, TeamID, etc
func addAppLocally(ctx context.Context, clients *shared.ClientFactory, log *logger.Logger, app types.App) (types.App, error) {
log.Info("on_apps_add_local")
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: Another event that was broadcast with no subscribers.

return installState, types.App{}, slackerror.Wrap(err, slackerror.ErrAppAdd)
}

log.Info("on_apps_add_remote_success")
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: another event that was broadcast with no subscribers 😿

Comment on lines +129 to +135
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
Emoji: "books",
Text: "App Manifest",
Secondary: []string{
fmt.Sprintf(`Updated app manifest for "%s" in "%s"`, slackManifest.DisplayInformation.Name, *authSession.TeamName),
},
}))
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: Example of replacing the event broadcast with the actual output.

Comment on lines -159 to -161
appManageURL := fmt.Sprintf("%s/apps", apiInterface.Host())
log.Data["appURL"] = fmt.Sprintf("%s%s", appManageURL, app.AppID)
log.Data["appName"] = manifest.DisplayInformation.Name
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: appURL was never output anywhere.

@mwbrooks mwbrooks changed the title refactor: remove logger from app install, add, and function mocks refactor: remove logger from install command Mar 6, 2026
Comment on lines +129 to +135
_, _ = clients.IO.WriteOut().Write([]byte("\n" + style.Sectionf(style.TextSection{
Emoji: "books",
Text: "App Manifest",
Secondary: []string{
fmt.Sprintf(`Updated app manifest for "%s" in "%s"`, slackManifest.DisplayInformation.Name, *authSession.TeamName),
},
})))
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: I'm using the identical clients.IO.WriteOut() syntax from cmd/ to avoid introducing formatting issues. The clients.IO.PrintInfo inserts newlines after the output, causing issues.

@mwbrooks mwbrooks marked this pull request as ready for review March 7, 2026 00:08
@mwbrooks mwbrooks requested a review from a team as a code owner March 7, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant