Skip to content

Commit 249fb52

Browse files
mwbrookszimeg
andauthored
docs: add docs for deprecating a feature (#74)
* docs: add docs for deprecating a feature * Update .github/MAINTAINERS_GUIDE.md Co-authored-by: Eden Zimbelman <[email protected]> --------- Co-authored-by: Eden Zimbelman <[email protected]>
1 parent eac66e3 commit 249fb52

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

.github/MAINTAINERS_GUIDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,18 @@ Testing in our CI setup uses changes to these files when creating test builds.
578578
Many good things come to an end. This can sometimes include commands and flags.
579579
When commands or flags need to be removed, follow these steps:
580580

581+
<details>
582+
<summary>Deprecating features</summary>
583+
584+
- Public functionality should be deprecated on the next `semver:major` version
585+
- Add the comment `// DEPRECATED(semver:major): Description about the deprecation and migration path`
586+
- Print a warning `PrintWarning("DEPRECATED: Description about the deprecation and migration path")`
587+
- Internal functionality can be deprecated anytime
588+
- Add the comment `// DEPRECATED: Description about the deprecation and migration path`
589+
- Please add deprecation comments generously to help the next person completely remove the feature and tests
590+
591+
</details>
592+
581593
<details>
582594
<summary>Deprecating commands</summary>
583595

internal/config/project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func (c *ProjectConfig) GetProjectDirPath() (string, error) {
316316
if _, err := c.fs.Stat(projectHooksJSONPath); os.IsNotExist(err) {
317317

318318
// Fallback check for slack.json and .slack/slack.json file
319-
// TODO(semver:major): remove both fallbacks next major release
319+
// DEPRECATED(semver:major): remove both fallbacks next major release
320320
projectSlackJSONPath := filepath.Join(currentDir, "slack.json")
321321
if _, err := c.fs.Stat(projectSlackJSONPath); err == nil {
322322
return currentDir, nil

internal/pkg/create/create_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ func Test_Create_installProjectDependencies(t *testing.T) {
129129
},
130130
unexpectedOutputs: []string{
131131
"Found project-name/.slack/hooks.json", // Behind bolt experiment
132-
"project-name/slack.json", // TODO(semver:major) Deprecated
132+
"project-name/slack.json", // DEPRECATED(semver:major): Now use hooks.json
133133
},
134134
expectedVerboseOutputs: []string{
135135
"Detected a project using Deno",
136136
},
137137
},
138138
"When no bolt experiment and slack.json exists, should output adding .slack and caching steps": {
139139
existingFiles: map[string]string{
140-
"slack.json": "{}", // TODO(semver:major) Included with the template (deprecated path)
140+
"slack.json": "{}", // DEPRECATED(semver:major): Included with the template (deprecated path)
141141
},
142142
expectedOutputs: []string{
143143
"Added project-name/.slack",
@@ -188,7 +188,7 @@ func Test_Create_installProjectDependencies(t *testing.T) {
188188
},
189189
expectedOutputs: []string{
190190
"Added project-name/.slack",
191-
"Found project-name/slack.json", // TODO(semver:major) Deprecated
191+
"Found project-name/slack.json", // DEPRECATED(semver:major): Now use hooks.json
192192
"Cached dependencies with deno cache import_map.json",
193193
},
194194
expectedVerboseOutputs: []string{

internal/shared/clients.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (c *ClientFactory) InitSDKConfig(ctx context.Context, dirPath string) error
200200
break
201201
}
202202
// Then, fallback to hooks in the deprecated project slack.json file
203-
// TODO(semver:major) - Drop support on the next major
203+
// DEPRECATED(semver:major) - Drop support on the next major
204204
hooksJSONFilePath = filepath.Join(dirPath, "slack.json")
205205
info, err = c.Fs.Stat(hooksJSONFilePath)
206206
if err == nil && !info.IsDir() {
@@ -210,7 +210,7 @@ func (c *ClientFactory) InitSDKConfig(ctx context.Context, dirPath string) error
210210
// Next, search for the hooks files in the outdated path
211211
// .slack/slack.json and display an error that this path
212212
// is deprecated
213-
// TODO(semver:major) - Drop support on the next major
213+
// DEPRECATED(semver:major) - Drop support on the next major
214214
hooksJSONFilePath = filepath.Join(dirPath, ".slack", "slack.json")
215215
info, err = c.Fs.Stat(hooksJSONFilePath)
216216
if err == nil && !info.IsDir() {
@@ -220,7 +220,7 @@ func (c *ClientFactory) InitSDKConfig(ctx context.Context, dirPath string) error
220220
// Next, search for the hooks files in the outdated path
221221
// .slack/cli.json and display an error that this path
222222
// is deprecated
223-
// TODO(semver:major) - Drop support on the next major
223+
// DEPRECATED(semver:major) - Drop support on the next major
224224
hooksJSONFilePath = filepath.Join(dirPath, ".slack", "cli.json")
225225
info, err = c.Fs.Stat(hooksJSONFilePath)
226226
if err == nil && !info.IsDir() {

0 commit comments

Comments
 (0)