Skip to content

refactor: move slack url creation to its own package#5225

Draft
santiagofn wants to merge 2 commits into
prometheus:mainfrom
santiagofn:refactor/slack-extract-apiurl-pkg
Draft

refactor: move slack url creation to its own package#5225
santiagofn wants to merge 2 commits into
prometheus:mainfrom
santiagofn:refactor/slack-extract-apiurl-pkg

Conversation

@santiagofn
Copy link
Copy Markdown

@santiagofn santiagofn commented May 6, 2026

Part 2 of a series implementing threaded message support for the Slack notifier. Full picture: #5150. Depends on #5224.

Summary

Extracts Slack API URL resolution logic from slack.go into a new internal package notify/slack/internal/apiurl. Adds comprehensive unit tests covering all resolution paths (direct URL, file-based, global config).

santiagofn added 2 commits May 6, 2026 14:33
Signed-off-by: Santiago Fernández Núñez <[email protected]>
Signed-off-by: Santiago Fernández Núñez <[email protected]>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 403444e4-5d82-45b0-bd65-9080ddc9d982

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@SoloJacobs SoloJacobs left a comment

Choose a reason for hiding this comment

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

It looks like this was largely AI-generated. We'd ask that contributions be reviewed and understood by the author before submitting, including making sure the commit message accurately describes what the code actually does. The message here says "refactor" but the change alters behavior. Happy to look at it again once it's been properly reviewed on your end.

@santiagofn
Copy link
Copy Markdown
Author

It looks like this was largely AI-generated. We'd ask that contributions be reviewed and understood by the author before submitting, including making sure the commit message accurately describes what the code actually does. The message here says "refactor" but the change alters behavior. Happy to look at it again once it's been properly reviewed on your end.

hi, @SoloJacobs , sorry for the delay. one comment before all: this is still a draft, that's why i didn't share it on slack. regarding the comments, i not only reviewed but wrote code, the PR was not solely generated by AI. i chose a "refactor" label because the current behaviour was not change (the same URLs are generated in the current flow). what the PR did add was the ability of creating URLs for other methods... but they're not in use nowadays. anyways, it might be worth using a "feature" if you believe that potential use warrants it.

@SoloJacobs
Copy link
Copy Markdown
Contributor

Thanks for the context. To be more precise though: The commit description says "move", which implies pure relocation.

  • The chat.update URL changed from hardcoded (https://slack.com/api/chat.update) to derived from the configured base URL, which is a behavioral change for anyone using a custom api_url.
  • The URL logic went from ~12 lines to 108. If this is a "move", then we is all the extra logic necessary?

So, the "refactor" part is not really the issue, you could leave it. Although, feat does seem a bit more accurate to me, since you introduce a new capability. But that is secondary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants