Skip to content

refactor: remove unused ProjectID function - #715

Merged
mwbrooks merged 2 commits into
mainfrom
mwbrooks-remove-dead-project-id
Oct 23, 2026
Merged

mwbrooks merged 2 commits into
mainfrom
mwbrooks-remove-dead-project-id

Conversation

@mwbrooks

Copy link
Copy Markdown
Member

Changelog

N/A - internal cleanup with no user-facing changes.

Summary

This pull request removes ProjectID from internal/slackcontext/slackcontext.go for maintainers, because the Go deadcode tool reports it as unreachable. Less unused code to read and keep compiling.

  • Removes ProjectID from internal/slackcontext/slackcontext.go
  • Removes its unit tests from internal/slackcontext/slackcontext_test.go

Testing

  1. Run go run golang.org/x/tools/cmd/deadcode@latest ./... | grep ProjectID and confirm there's no output
  2. Run go build ./... && go test ./... and confirm both pass

Requirements

@mwbrooks
mwbrooks requested a review from a team as a code owner October 23, 2026 18:39
@mwbrooks mwbrooks added this to the Next Release milestone Oct 23, 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 Oct 23, 2026
@mwbrooks mwbrooks self-assigned this Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.10%. Comparing base (0e78f36) to head (8af24a6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #715   +/-   ##
=======================================
  Coverage   78.09%   78.10%           
=======================================
  Files         238      238           
  Lines       18106    18101    -5     
=======================================
- Hits        14140    14137    -3     
+ Misses       3966     3964    -2     

☔ View full report in Codecov by Harness.
📢 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.

Comment on lines -82 to -92
// ProjectID returns the project ID associated with `ctx`, or
// `""` and `slackerror.ErrContextValueNotFound` if no project ID could be found.
func ProjectID(ctx context.Context) (string, error) {
var projectID, ok = ctx.Value(contextKeyProjectID).(string)
if !ok || projectID == "" {
return "", slackerror.New(slackerror.ErrContextValueNotFound).
WithMessage("The value for Project ID could not be found")
}
return projectID, nil
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

note: Kinda amazed we don't use the ProjectID anywhere. 🤷🏻

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

@mwbrooks Let's keep removing code that's not called elsewhere! Thanks for digging into this again 🤓

@mwbrooks
mwbrooks enabled auto-merge (squash) October 23, 2026 20:09
@mwbrooks
mwbrooks merged commit 25607fb into main Oct 23, 2026
13 checks passed
@mwbrooks
mwbrooks deleted the mwbrooks-remove-dead-project-id branch October 23, 2026 20:12
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.

2 participants