ci(danger): Clean up API notifications after move to main-only posts (#4101)
- Removes the now-unreachable `else` arm of the outcome `case` in
`danger/announce_api_changes.rb`.
- Drops dedup entirely. One pipeline runs `announce-api-changes` per
main commit, so we'll only get notifications for changes to main.
- Other small related cleanups
- iOS counterpart: https://github.com/RevenueCat/purchases-ios/pull/7516
### Checklist
- [x] If applicable, unit tests
- [ ] If applicable, create follow-up issues for `purchases-ios` and
hybrids
<details><summary>Agent description</summary>
### Motivation
Follow-up to #4083, which moved the `#feed-sdk-new-api` announcement to
`main` only and flagged its leftovers. On Android the leftovers are two
unreachable lines, so this PR is small.
The `--no-ext-diff` fix was found while verifying the rest. Driving the
runner on real history (`68b12a7a5`, the `setSingularDeviceID` merge)
with credentials unset returned nil instead of a report. The cause was a
local `diff.external = difft`: `patch_between` shells out to `git diff`,
git substitutes the external differ, and the resulting output has no
`+`/`-` prefixes for `declarations` to find. The runner then prints
"changed, but no declaration did" and exits 0.
That is the same failure mode #4083 called out under risks, a quiet feed
with a green job, reachable through a developer's git config rather than
through Slack being down.
### Description
- `danger/api_diff_report.rb`: `patch_between` passes `--no-ext-diff`.
Deletes `history_request`, `recent_messages`, `last_announcement`,
`announcement_state`, `CHANNEL_ID` and `SLACK_HISTORY_LIMIT`;
`announce_to_slack` loses its `source` and `getter` params and returns
`:posted` or `:failed`, never `:duplicate`. The `announce: false` early
return is now `{ comment: }` only, since nothing was attempted, so there
is no outcome and nothing to warn about.
- `Dangerfile`: the `if api_diff` block collapses to one `markdown`
call.
- `danger/announce_api_changes.rb`: the outcome `case` is down to
`:posted` and `:failed`.
- `changed_signature_files` needs no flag: `--name-only` does not go
through an external differ.
### Regression gates
`test_patch_between_asks_git_for_that_one_file_ignoring_any_external_differ`
asserts the flag is in the argv. That is the whole fix, and nothing else
would catch its removal: with an external differ configured the report
silently empties, and without one the tests pass either way.
**Not visible in the diff:** one webhook pipeline runs per main commit.
The daily `api`-triggered pipeline lands on an already-built commit
(`68b12a7`) without running the announce job, so nothing fires the
announcement twice on its own. The runner has nothing after the post
that can fail, so it needs no reordering, unlike iOS.
After the `--no-ext-diff` fix the runner reproduces the real message
locally, `New public API landed on main · Android :android: · purchases`
with `+ method public void setSingularDeviceID(String?
singularDeviceID);`, which matches what #4083 reported from CI.
**Rejected:**
- Keeping dedup as rerun insurance. It only made a manual rerun
idempotent, and it did so through a token scope and a channel-ID format
that fail silently: with either wrong, `announcement_state` returned
`:unknown` and posted anyway.
- Setting `GIT_EXTERNAL_DIFF=` or unsetting the config in the runner.
Wider blast radius than one flag on the one call that parses a patch,
and it would not survive someone adding a second `git diff` caller.
- Raising when the patch parses to nothing. `changed_signature_files`
legitimately reports a signature file whose diff holds no declaration
(whitespace, a moved comment), so "no declarations" cannot be treated as
an error by itself.
</details>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> CI/Danger tooling only; removes dedup (acceptable with one announce
job per main commit) and fixes a quiet false-negative when external diff
tools are configured.
>
> **Overview**
> **Cleans up public API Slack announcements** after moving them to
main-only: duplicate detection via `conversations.history` is removed,
so each run posts once and outcomes are only `:posted` or `:failed` (no
`:duplicate` / `:skipped` on announce paths).
>
> **`patch_between` now runs `git diff --no-ext-diff`** so a developer’s
`diff.external` config cannot yield unparseable output and silently skip
API declaration detection.
>
> **Dangerfile** only adds the API diff markdown comment when a report
exists; it no longer surfaces `api_diff[:warning]`. **`announce:
false`** returns `{ comment: }` only; failed Slack posts still warn via
`announce_api_changes.rb`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
33c86c50afdc9aceb7fb2a5086f3ff9217185d1e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY --> Á
Álvaro Brey committed
add9676a31ee9174ff76c8c3e04bb906e818a0af
Parent: 71636bc
Committed by GitHub <noreply@github.com>
on 8/27/2026, 9:00:15 AM