Skip to content

Redesign Discord notification infrastructure#7

Closed
robbykap wants to merge 33 commits intomainfrom
claude/wonderful-lovelace
Closed

Redesign Discord notification infrastructure#7
robbykap wants to merge 33 commits intomainfrom
claude/wonderful-lovelace

Conversation

@robbykap
Copy link
Copy Markdown
Collaborator

@robbykap robbykap commented Mar 31, 2026

Summary

Redesigns Discord notifications into a shared message-oriented system, keeps PyPI on the embed path, and upgrades Canvas and Docker notifications to a cleaner hybrid layout with a compact metadata embed plus markdown body content.

What changed

  • Canvas and Docker notifications now send a colored metadata embed plus markdown sections for status, review items, published items, failed images, errors, and run links
  • Discord delivery now supports ordered webhook messages, plain-text section chunking, legacy embed chunking, and first-chunk embed retention for hybrid messages
  • Reusable course workflows now require course_name and course_url, pass github.ref_name, and support utils_ref for smoke testing reusable workflows safely
  • Notification dependencies now install markdowndata anywhere shared formatting is used
  • PyPI/OIDC work from this PR branch stays intact while using the newer shared notification message model

Downstream PRs

PyPI OIDC PRs

Merge these alongside the utils OIDC changes:

Repo PR Status
mdx-canvas #133 OIDC migration
markdowndata #7 OIDC migration
byu_pytest_utils #52 OIDC migration

Course workflow input PRs

These add the new required course_name and course_url inputs to caller workflows before the updated reusable course workflows land on main:

Repo PR Status
CS235-course-content #256 Add required course notification inputs
CS110-course-content #56 Add required course notification inputs
CS312-course-content #215 Add required course notification inputs
CS301R-Agent-Engineering-Course-Content #40 Add required course notification inputs

Test harness

testkapua/testing-repo was updated directly on main and used for end-to-end Canvas and Docker smoke tests.


Caller changes required

PyPI workflows

The poetry_publish.yaml workflow uses trusted publishers instead of username/password secrets.

  1. Configure a trusted publisher on PyPI for each package repo
  2. Add workflow-level permissions: id-token: write
  3. Remove pypi_user and pypi_password from caller workflow secrets

Canvas / Docker workflows

Canvas and Docker callers now need these required inputs:

with:
  course_id: "235"
  course_name: "CS 235 Spring 2025"
  course_url: "https://byu.instructure.com/courses/12345"

utils_ref remains optional and is only intended for smoke tests against a non-main utils branch.


Verified

  • Canvas notification — end-to-end tested via testkapua/testing-repo with the hybrid embed + markdown layout
  • Docker notification — end-to-end tested via testkapua/testing-repo on both workflow_dispatch and push-triggered change paths
  • Course notification formatting and chunking — PYTHONPATH=. pytest -q passes with 25 tests
  • Legacy PyPI embed chunking coverage remains in place
  • OIDC publish — still needs trusted publishers configured on real package repos

Post-merge checklist

robbykap and others added 26 commits February 13, 2026 12:16
This reverts commit c61eb59.
- Canvas: Add course name/link, resource type summary counts, move
  Content to Review above Deployed Content for skimmability
- Docker: Add course name/link, summary counts, move Failed Images
  above Updated Images
- PyPi: Add PyPI package link, version transition display (old -> new),
  migrate to OIDC trusted publishers (pypa/gh-action-pypi-publish)
- Fix check_toml.yaml to explicitly output uped_toml=false on failure
- Fix docker_automation.yaml uses: path to full repo reference
- Fix github.ref -> github.ref_name for clean branch display
- Quote all CLI args in send-pypi-notification action
- Expose pypi_version output from check_toml workflow
- Add shared helpers: build_resource_summary, resource_count_fields,
  course_info_field
- Add pypi_name column to style.md for URL generation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All composite action uses: references were still pointing to
canvas-notification-updates instead of this branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use jq '// empty' to avoid outputting literal "null" string
- Only pass icon_url to set_author when it's truthy
- Prevents Discord 400 errors from invalid author icon URLs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reusable workflows (workflow_call) don't support workflow-level
permissions. Move id-token: write to the poetry-publish job that
needs it for OIDC trusted publisher auth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The ./ relative path resolves to the calling repo, not this repo,
causing startup_failure when called cross-repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
check_toml.yaml doesn't declare any secrets, so inherit may
cause validation issues on the nested reusable workflow call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Nested reusable workflow calls across repos cause startup_failure.
Inlining eliminates the nesting and removes duplicated poetry
install/build steps that ran in both jobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All utils repo checkouts now specify the branch ref so the
notifications package is available. PyPI version query uses
jq '// empty' to avoid passing literal 'null' strings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The notifications package imports markdowndata for style parsing,
but it wasn't being installed in pip install steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Calling workflows must also grant id-token: write permission
for the trusted publisher flow to work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace claude/wonderful-lovelace refs with main for all workflow
checkout steps and composite action references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document the PyPI OIDC trusted publisher migration, add optional
course_info_path/global_args_path to Docker example, and include
post-merge cleanup notes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
robbykap added a commit to BYU-CS-Course-Ops/mdx-canvas that referenced this pull request Apr 1, 2026
Replace pypi_user/pypi_password secrets with OIDC trusted publisher
authentication. Add permissions: id-token: write at workflow level
as required by the reusable workflow in BYU-CS-Course-Ops/utils.

See: BYU-CS-Course-Ops/utils#7
robbykap added a commit to BYU-CS-Course-Ops/markdowndata that referenced this pull request Apr 1, 2026
Replace pypi_user/pypi_password secrets with OIDC trusted publisher
authentication. Add permissions: id-token: write at workflow level
as required by the reusable workflow in BYU-CS-Course-Ops/utils.

See: BYU-CS-Course-Ops/utils#7
robbykap added a commit to BYU-CS-Course-Ops/byu_pytest_utils that referenced this pull request Apr 1, 2026
Replace pypi_user/pypi_password secrets with OIDC trusted publisher
authentication. Add permissions: id-token: write at workflow level
as required by the reusable workflow in BYU-CS-Course-Ops/utils.

See: BYU-CS-Course-Ops/utils#7
robbykap added a commit to BYU-CS-Course-Ops/mdx-canvas that referenced this pull request Apr 1, 2026
The push trigger is temporarily removed to prevent failed workflow
runs on merge. Re-enable it after:
1. BYU-CS-Course-Ops/utils#7 is merged
2. A trusted publisher is configured on pypi.org for this repo
robbykap added a commit to BYU-CS-Course-Ops/markdowndata that referenced this pull request Apr 1, 2026
The push trigger is temporarily removed to prevent failed workflow
runs on merge. Re-enable it after:
1. BYU-CS-Course-Ops/utils#7 is merged
2. A trusted publisher is configured on pypi.org for this repo
robbykap added a commit to BYU-CS-Course-Ops/byu_pytest_utils that referenced this pull request Apr 1, 2026
The push trigger is temporarily removed to prevent failed workflow
runs on merge. Re-enable it after:
1. BYU-CS-Course-Ops/utils#7 is merged
2. A trusted publisher is configured on pypi.org for this repo
@robbykap
Copy link
Copy Markdown
Collaborator Author

robbykap commented Apr 1, 2026

Superseded by new PR from codex-plain-text-notifications branch

@robbykap robbykap closed this Apr 1, 2026
@robbykap robbykap deleted the claude/wonderful-lovelace branch April 1, 2026 19:56
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.

1 participant