Commit 7271ae2
ci: add nightly contract tests with long-running tests and Slack notification (#136)
**Requirements**
- [x] I have followed the repository's [pull request submission
guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
**Related issues**
N/A
**Describe the solution you've provided**
Adds a new GitHub Actions workflow that runs the Java server SDK
contract tests nightly (4am UTC) with the `-enable-long-running-tests`
flag enabled. If the tests fail, a Slack notification is sent to alert
the team.
Key details:
- **Schedule**: Runs daily at 4am UTC via cron, with `workflow_dispatch`
for manual triggering (supports custom branch and Slack test
notification inputs)
- **Test execution**: Reuses the existing `ci` and `contract-tests`
composite actions; the `contract-tests` action now accepts a
`test_harness_params` input to pass `-enable-long-running-tests`
- **Slack notification**: Uses `slackapi/slack-github-action` (pinned to
v2.1.1 SHA) with an incoming webhook (`SLACK_WEBHOOK_URL` secret) to
post to Slack on failure, including a link to the failed run
- **Test Slack job**: A separate `test-slack-notification` job can be
triggered manually via `workflow_dispatch` to verify the Slack
integration is working
- **Contract test service updates**: Added `server-side-polling`
capability and polling parameter support to the test service entity
- **FDv2 suppressions**: Three `streaming/fdv2` fallback/recovery tests
are suppressed pending spec alignment between Go and Java
implementations
**Items for reviewer attention:**
1. **`SLACK_WEBHOOK_URL` secret** — must be configured in the repo
settings with a webhook routed to `#sdks-java`. The channel is
determined by the webhook configuration, not the workflow.
2. **No `timeout-minutes`** — long-running tests could potentially hang
indefinitely. Consider adding a timeout.
3. **Notification scope** — the Slack job triggers on `failure` only,
not `cancelled` or `timed_out`. Decide if those states should also
notify.
4. **Contract test service changes** — verify the new polling support in
`SdkClientEntity.java` is correct, particularly the conditional logic
for `params.polling != null && params.dataSystem == null` and the base
URI endpoint wiring.
**Describe alternatives you've considered**
- Could use `rtCamp/action-slack-notify` (used by `ldcli`) instead of
`slackapi/slack-github-action`, but the official Slack action is more
widely used across LD repos (`terraform-provider-launchdarkly`,
`streamer`, `ld-docs-private`).
**Updates since initial revision**
- Extended `contract-tests` composite action with `test_harness_params`
input instead of splitting out individual make targets (addresses
original item #4)
- Added `workflow_dispatch` inputs for branch selection and Slack
notification testing
- Added `test-slack-notification` job for verifying Slack integration
- Added `server-side-polling` capability and polling params to the
contract test service
- Added 3 FDv2 streaming fallback/recovery test suppressions (pending
spec alignment)
- Pinned `slackapi/slack-github-action` to v2.1.1 SHA
(`91efab103c0de0a537f72a35f6b8cda0ee76bf0a`)
**Additional context**
[Link to Devin
run](https://app.devin.ai/sessions/9fb4e81a67fd47098803d5d7dabd008b)
Requested by: tanderson@launchdarkly.com
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Primarily CI/workflow changes, but it also adjusts contract-test
service configuration logic for polling which could alter how tests
initialize and exercise the SDK.
>
> **Overview**
> Adds a new `Nightly Contract Tests` GitHub Actions workflow that runs
server SDK contract tests nightly (and on manual dispatch), with an
optional branch override and an optional Slack test-notification path.
>
> Extends the `contract-tests` composite action to accept
`test_harness_params` and pass them through to `make`, enabling the
nightly workflow to run the harness with `-enable-long-running-tests`,
and posts a Slack alert via an incoming webhook when the nightly job
fails.
>
> Updates the contract test service to advertise `server-side-polling`,
accept polling config (including a `filter`), and wire polling
endpoints/data source when streaming isn’t used; also adds FDv2
suppressions for several streaming fallback/recovery tests.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
69b9f64. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tanderson@launchdarkly.com <tanderson@launchdarkly.com>
Co-authored-by: Todd Anderson <127344469+tanderson-ld@users.noreply.github.com>
Co-authored-by: semgrep-code-launchdarkly[bot] <167133144+semgrep-code-launchdarkly[bot]@users.noreply.github.com>1 parent 2b68876 commit 7271ae2
File tree
6 files changed
+127
-3
lines changed- .github
- actions/contract-tests
- workflows
- lib/sdk/server/contract-tests
- service/src/main/java/sdktest
6 files changed
+127
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | | - | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
404 | 414 | | |
405 | 415 | | |
406 | 416 | | |
| |||
463 | 473 | | |
464 | 474 | | |
465 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
466 | 481 | | |
467 | 482 | | |
468 | 483 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments