Skip to content

Simplify PR dashboard state loading#45

Merged
trask merged 1 commit into
open-telemetry:mainfrom
trask:pull-request-dashboard-explicit-state-loading
Jul 8, 2026
Merged

Simplify PR dashboard state loading#45
trask merged 1 commit into
open-telemetry:mainfrom
trask:pull-request-dashboard-explicit-state-loading

Conversation

@trask

@trask trask commented Jul 7, 2026

Copy link
Copy Markdown
Member

Misc refactoring. I split this out of a bigger (to come) PR addressing #40.

Replace transient in-band dashboard and notification state markers with explicit missing-state handling.

Targeted dashboard refreshes now skip cleanly without accepted cached state, notification processing skips without dashboard state, and Slack notification calculations operate on per-PR notification records with delivery errors returned separately.

Also a good bit of renaming to make it clearer what is going on in some places.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors state loading in the PR dashboard tooling, replacing the transient in-band _loaded_from_dashboard (and _notification_errors) markers with explicit missing-state handling via None returns. The result is a clearer contract: a targeted single-PR refresh now skips cleanly when there is no accepted cached dashboard state (instead of falling back to a full rebuild), notification processing skips when dashboard state is absent, and Slack notification computation operates on per-PR notification records with delivery errors returned as a separate value.

Changes:

  • load_state_file and cache loaders now return None for missing/invalid state, and legacy _-prefixed markers are stripped on load.
  • Notification helpers are reworked to per-PR records (load_notifications/save_notifications/union_merge_notifications), and next_notifications returns (notifications, delivery_errors).
  • Single-PR refreshes skip when no accepted dashboard state exists; compute_pr_results receives dashboard_state as an explicit argument.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/scripts/pull-request-dashboard/state.py Return None for missing state, strip legacy markers, add per-PR notification load/save/merge helpers
.github/scripts/pull-request-dashboard/notify_slack.py Skip on missing dashboard state, merge retry snapshot via last_notifications, rename retry-snapshot/error paths
.github/scripts/pull-request-dashboard/notifications.py Rename to next_notifications, return errors separately, gate initial notifications on has_last_notifications
.github/scripts/pull-request-dashboard/dashboard.py Pass dashboard_state into compute_pr_results, skip targeted refresh on cache miss, handle None in reconciliation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@trask trask marked this pull request as ready for review July 7, 2026 23:52
@trask trask requested a review from a team as a code owner July 7, 2026 23:52
@trask trask merged commit eb2606d into open-telemetry:main Jul 8, 2026
5 checks passed
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.

3 participants