Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/MAINTAINERS_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,18 @@ Testing in our CI setup uses changes to these files when creating test builds.
Many good things come to an end. This can sometimes include commands and flags.
When commands or flags need to be removed, follow these steps:

<details>
<summary>Deprecating features</summary>

- Public functionality should be deprecated on the next `semver:major` version
- Add the comment `// DEPRECATED(semver:major): Description about the deprecation and migration path`
- Print a warning `PrintWarning("DEPRECATED: Description about the deprecation and migration path")`
Copy link
Member

Choose a reason for hiding this comment

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

This will be so helpful in moving to the next major versions! I am a big fan of this pattern, even if it causes noise after an update 📚 ✨

- Internal functionality can be deprecated anytime
- Add the comment `// DEPRECATED: Description about the deprecation and migration path`
- Please add deprecation comments generously to help the next person completely remove the feature and tests

</details>

<details>
<summary>Deprecating commands</summary>

Expand Down
2 changes: 1 addition & 1 deletion internal/config/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (c *ProjectConfig) GetProjectDirPath() (string, error) {
if _, err := c.fs.Stat(projectHooksJSONPath); os.IsNotExist(err) {

// Fallback check for slack.json and .slack/slack.json file
// TODO(semver:major): remove both fallbacks next major release
// DEPRECATED(semver:major): remove both fallbacks next major release
Copy link
Member

Choose a reason for hiding this comment

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

This is so much more obvious! 🙏

I find searches for TODO raised false positives and I'm so glad to align on the go conventions you note 📝

Also, thanks for finding these instances in code!

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, so far this makes assessing the effort involved in removing a deprecation a lot easier!

projectSlackJSONPath := filepath.Join(currentDir, "slack.json")
if _, err := c.fs.Stat(projectSlackJSONPath); err == nil {
return currentDir, nil
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/create/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ func Test_Create_installProjectDependencies(t *testing.T) {
},
unexpectedOutputs: []string{
"Found project-name/.slack/hooks.json", // Behind bolt experiment
"project-name/slack.json", // TODO(semver:major) Deprecated
"project-name/slack.json", // DEPRECATED(semver:major): Now use hooks.json
},
expectedVerboseOutputs: []string{
"Detected a project using Deno",
},
},
"When no bolt experiment and slack.json exists, should output adding .slack and caching steps": {
existingFiles: map[string]string{
"slack.json": "{}", // TODO(semver:major) Included with the template (deprecated path)
"slack.json": "{}", // DEPRECATED(semver:major): Included with the template (deprecated path)
},
expectedOutputs: []string{
"Added project-name/.slack",
Expand Down Expand Up @@ -188,7 +188,7 @@ func Test_Create_installProjectDependencies(t *testing.T) {
},
expectedOutputs: []string{
"Added project-name/.slack",
"Found project-name/slack.json", // TODO(semver:major) Deprecated
"Found project-name/slack.json", // DEPRECATED(semver:major): Now use hooks.json
"Cached dependencies with deno cache import_map.json",
},
expectedVerboseOutputs: []string{
Expand Down
6 changes: 3 additions & 3 deletions internal/shared/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (c *ClientFactory) InitSDKConfig(ctx context.Context, dirPath string) error
break
}
// Then, fallback to hooks in the deprecated project slack.json file
// TODO(semver:major) - Drop support on the next major
// DEPRECATED(semver:major) - Drop support on the next major
hooksJSONFilePath = filepath.Join(dirPath, "slack.json")
info, err = c.Fs.Stat(hooksJSONFilePath)
if err == nil && !info.IsDir() {
Expand All @@ -210,7 +210,7 @@ func (c *ClientFactory) InitSDKConfig(ctx context.Context, dirPath string) error
// Next, search for the hooks files in the outdated path
// .slack/slack.json and display an error that this path
// is deprecated
// TODO(semver:major) - Drop support on the next major
// DEPRECATED(semver:major) - Drop support on the next major
hooksJSONFilePath = filepath.Join(dirPath, ".slack", "slack.json")
info, err = c.Fs.Stat(hooksJSONFilePath)
if err == nil && !info.IsDir() {
Expand All @@ -220,7 +220,7 @@ func (c *ClientFactory) InitSDKConfig(ctx context.Context, dirPath string) error
// Next, search for the hooks files in the outdated path
// .slack/cli.json and display an error that this path
// is deprecated
// TODO(semver:major) - Drop support on the next major
// DEPRECATED(semver:major) - Drop support on the next major
hooksJSONFilePath = filepath.Join(dirPath, ".slack", "cli.json")
info, err = c.Fs.Stat(hooksJSONFilePath)
if err == nil && !info.IsDir() {
Expand Down
Loading