Skip to content

OCPEDGE-2695: Add decision notification#202

Merged
openshift-merge-bot[bot] merged 5 commits into
openshift-eng:mainfrom
eggfoobar:add-decision-notification
Jun 26, 2026
Merged

OCPEDGE-2695: Add decision notification#202
openshift-merge-bot[bot] merged 5 commits into
openshift-eng:mainfrom
eggfoobar:add-decision-notification

Conversation

@eggfoobar

@eggfoobar eggfoobar commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added a Friday (UTC) “pending team decisions” digest to both the Slack webhook and the HTML dashboard, showing only proposed items and including contributions from open PRs.
    • Slack messages now optionally include a pending decisions section and display an updated pending count when applicable.
  • Documentation
    • Updated README with the Friday-specific behavior, required GitHub token permissions, and dashboard/Slack details.
  • Tests
    • Added unit tests covering decision filename handling, frontmatter parsing, title extraction, status filtering, and digest object construction.

add an extra check on Fridays to the gh-notifier to gather information on pending ADR for edge-context

Signed-off-by: ehila <ehila@redhat.com>
… html

Signed-off-by: ehila <ehila@redhat.com>
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eggfoobar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 68302eba-54c4-4be6-9bf1-2fd425388c9e

📥 Commits

Reviewing files that changed from the base of the PR and between 214465f and 3556b37.

📒 Files selected for processing (2)
  • gh-notifier/gh-notifier.py
  • gh-notifier/tests/test_decisions.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • gh-notifier/tests/test_decisions.py
  • gh-notifier/gh-notifier.py

Walkthrough

gh-notifier.py now loads Friday-UTC pending decisions from openshift-eng/edge-context and adds them to Slack output and the HTML dashboard. README.md and new tests document and cover the decision helpers and Friday gating.

Changes

Friday pending-decisions digest

Layer / File(s) Summary
Docs and module summary
gh-notifier/README.md, gh-notifier/gh-notifier.py
README text and the module docstring describe the Friday-only pending-decisions behavior, permission requirement, and CI timing.
Decision discovery and Friday gating
gh-notifier/gh-notifier.py
Decision-file helpers parse edge-context content, extract titles and numbers, load proposed decisions from main and open PRs, and gate the digest to Friday UTC in main().
Slack payload updates
gh-notifier/gh-notifier.py
Both Slack payload builders accept pending decisions, append the pending-decisions section, and update the top-level text with the pending count.
HTML dashboard updates
gh-notifier/gh-notifier.py
The dashboard writer accepts pending decisions, computes the count, renders the pending-decisions metric and table, and inserts them into the page layout.
Decision helper tests
gh-notifier/tests/test_decisions.py
Tests cover filename matching, frontmatter parsing, title extraction, decision numbering, digest inclusion, and decision blob URL construction.
Decision iteration and pending-object tests
gh-notifier/tests/test_decisions.py
Tests cover main-branch file iteration, open-PR file iteration with pagination and path filtering, and pending-decision object creation from decision text.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • openshift-eng/edge-tooling#58: Introduced the original gh-notifier Slack and HTML dashboard builders that this PR extends with Friday pending decisions.
🚥 Pre-merge checks | ✅ 9 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Ai-Attribution ⚠️ Warning The commit mentions CodeRabbit suggestions (AI tool) but only includes Signed-off-by; no Assisted-by/Generated-by trailer is present. Add a Red Hat AI attribution trailer (Assisted-by or Generated-by) to the AI-assisted commit; do not use Co-Authored-By for AI tools.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is relevant and clearly points to the new decision-notification feature, which matches the main change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Weak-Crypto ✅ Passed No weak crypto or secret comparison code was added; searches found no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB usage, and the lone sha1 hit is a dummy test string.
Container-Privileges ✅ Passed PR only changes gh-notifier docs/Python/tests; no manifest-like files or privilege-related settings were added.
No-Sensitive-Data-In-Logs ✅ Passed No logs print tokens/passwords/PII; stderr messages only include repo/path, HTTP codes, and generic error bodies, not secret-bearing values.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets found: tokens/webhooks come from env vars, and searches found no literal credentials, base64 blobs, or embedded auth URLs in the touched files.
No-Injection-Vectors ✅ Passed No unsafe sinks found: decision data is parsed manually, and HTML/Slack output escapes user-controlled fields; no eval/shell/yaml.load/pickle.loads use.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gh-notifier/gh-notifier.py`:
- Around line 246-328: The new decision parsing logic in _DECISION_FILE_RE,
parse_frontmatter, extract_decision_title, decision_number_from_filename, and
_decision_included_for_digest needs positive and negative coverage. Add tests
for valid decision filenames/frontmatter and for malformed frontmatter, missing
status, and non-matching filenames, plus both branches of
_decision_included_for_digest under DECISIONS_TEST and normal mode. Use focused
unit tests around these helpers so the parsing and status-filtering behavior is
locked down.
- Around line 833-845: The HTML table row builder in gh-notifier.py is not
rendering the actual decision makers value, so the Decision makers column only
shows a generic link. Update the decision row assembly in the pending loop to
display the escaped decision_makers content from each item instead of the
placeholder text, while keeping the existing link and escaping behavior
consistent with the other cells in decision_rows.
- Around line 357-363: The file-fetch loop in gh_notifier.py currently only
catches HTTPError and ValueError, so a URLError from gh_get_repo_file can escape
and abort the digest. Update the exception handling in this per-file try/except
block to also catch urllib.error.URLError, log it as a warning via
sys.stderr.write with the same per-file context, and continue processing the
remaining decision files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 18bec8eb-f975-4a47-b5c5-ad5a6d366a06

📥 Commits

Reviewing files that changed from the base of the PR and between 089dd10 and 2702b59.

📒 Files selected for processing (2)
  • gh-notifier/README.md
  • gh-notifier/gh-notifier.py

Comment thread gh-notifier/gh-notifier.py Outdated
Comment thread gh-notifier/gh-notifier.py
Comment thread gh-notifier/gh-notifier.py
Signed-off-by: ehila <ehila@redhat.com>
@coderabbitai coderabbitai Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jun 24, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gh-notifier/gh-notifier.py`:
- Around line 296-309: The PR file scan only processes the first response from
the pull-request files endpoint, so later pages can miss decision files in
larger PRs. Update the file-loading logic in gh-notifier.py where files are
fetched and iterated to paginate through all `/pulls/{number}/files` results,
using either `per_page=100` with a `page` loop or by following `Link` headers,
and then keep the existing filename filtering and yield behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 084060e5-5865-4359-be35-e106b40272c5

📥 Commits

Reviewing files that changed from the base of the PR and between 2702b59 and 402d63c.

📒 Files selected for processing (3)
  • gh-notifier/README.md
  • gh-notifier/gh-notifier.py
  • gh-notifier/tests/test_decisions.py
✅ Files skipped from review due to trivial changes (2)
  • gh-notifier/README.md
  • gh-notifier/tests/test_decisions.py

Comment thread gh-notifier/gh-notifier.py Outdated
Signed-off-by: ehila <ehila@redhat.com>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gh-notifier/gh-notifier.py`:
- Around line 360-362: The decision blob URL builder is only quoting the ref, so
filenames used in PendingDecision.url can still break Slack `<url|label>` links
and dashboard links. Update `_decision_blob_url` and the related URL
construction call sites (the main and PR URL paths referenced in
`PendingDecision`) to percent-encode the path as well, using a shared helper so
characters like `|`, `>`, spaces, and `#` are safely quoted before embedding the
URL in Slack.

In `@gh-notifier/tests/test_decisions.py`:
- Line 15: The test setup currently hardcodes a fallback GITHUB_TOKEN value,
which should be removed to avoid embedding credentials in tests. Update the test
initialization in the relevant test module so it relies on the
environment-provided GITHUB_TOKEN at runtime instead of calling setdefault with
a literal, and keep the rest of the test logic unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 0a6ca307-fef4-4b24-bdd3-719db8dea1df

📥 Commits

Reviewing files that changed from the base of the PR and between 089dd10 and 428e979.

📒 Files selected for processing (3)
  • gh-notifier/README.md
  • gh-notifier/gh-notifier.py
  • gh-notifier/tests/test_decisions.py

Comment thread gh-notifier/gh-notifier.py Outdated
Comment thread gh-notifier/tests/test_decisions.py Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gh-notifier/gh-notifier.py`:
- Line 243: The decision filename matcher in _DECISION_FILE_RE is too permissive
and currently accepts nested paths like 0001-folder/notes.md after
iter_open_decision_files() strips the decisions/ prefix. Tighten the regex in
gh-notifier.py so it only matches a flat decisions/NNNN-slug.md filename and
rejects any slash-containing suffixes, then update the tests for
iter_open_decision_files() or the filename validation path to include both a
positive case and a negative nested-path case as required by CONTRIBUTING.md.

In `@gh-notifier/tests/test_decisions.py`:
- Around line 46-57: The non-decision filename test in
test_rejects_non_decision_files should also cover nested paths so the
decisions/NNNN-slug.md contract is enforced. Add a negative subtest for a path
like decisions/0001-folder/notes.md and verify _DECISION_FILE_RE does not match
it, keeping the existing regex behavior and test structure intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e7548aee-e443-414b-8c5b-c06b983aaa84

📥 Commits

Reviewing files that changed from the base of the PR and between 089dd10 and 214465f.

📒 Files selected for processing (3)
  • gh-notifier/README.md
  • gh-notifier/gh-notifier.py
  • gh-notifier/tests/test_decisions.py

Comment thread gh-notifier/gh-notifier.py Outdated
Comment thread gh-notifier/tests/test_decisions.py
Signed-off-by: ehila <ehila@redhat.com>
@eggfoobar eggfoobar force-pushed the add-decision-notification branch from 214465f to 3556b37 Compare June 25, 2026 20:34
@jeff-roche

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 09e1982 into openshift-eng:main Jun 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants