Skip to content

chore: sync workflow templates - #855

Closed
stranske wants to merge 1 commit into
mainfrom
sync/workflows-d0d4ad2bdd25
Closed

chore: sync workflow templates#855
stranske wants to merge 1 commit into
mainfrom
sync/workflows-d0d4ad2bdd25

Conversation

@stranske

@stranske stranske commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Sync Summary

Files Updated

  • agents-guard.yml: Agents guard - enforces agents workflow protections (Health 45)
  • tokens.css: Design-system theme tokens (theme-air/theme-paper + density axis). Override tokens in an app stylesheet loaded after this; do not fork.
  • components.css: Design-system component layer (.ds): panels/appbar/kpis/tables/fields + presentation-state patterns (.notice, .empty-state, .badge, .skeleton).
  • ds_streamlit.py: Streamlit adapter for the design system (inject_theme/empty_state/notice/error/translate_error/dev_note/availability_badge/humanize_id) so Streamlit apps consume the same presentation patterns.
  • PRESENTATION_PATTERNS.md: The presentation-patterns standard (P1-P6): the rule behind each pattern + per-app-type application + the finding->pattern map from the 2026-06 UX-Review fleet baseline.
  • README.md: Design-system usage guide: how to apply the theme + components/kit per app type.

Files Skipped

  • renovate.json: File exists and sync_mode is create_only
  • cross-repo-smoke.yml: File exists and sync_mode is create_only
  • llm_slots.json: None

Review Checklist

  • CI passes with updated workflows
  • No repo-specific customizations were overwritten

Source: stranske/Workflows
Source SHA: dfe0854ae9b1ba1c616e4b57fb498f283ea3216f
Template hash: d0d4ad2bdd25
Sync branch: sync/workflows-d0d4ad2bdd25
Consumer repo: stranske/Template
Manifest: .github/sync-manifest.yml

Summary by CodeRabbit

  • Accessibility Improvements

    • Added visible focus indicators for interactive elements
    • Added support for users with reduced-motion preferences in animations
  • UI/UX Enhancements

    • Improved error message handling and clarity
  • Security

    • Enhanced content safety through improved escaping mechanisms

Automated sync from stranske/Workflows
Template hash: d0d4ad2bdd25

Changes synced from sync-manifest.yml
@stranske stranske added sync Automated sync from Workflows automated Automated sync from Workflows labels Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates the design system's CSS with focus-visible outlines and reduced-motion skeleton support, bumps font token ordering in tokens.css, adds HTML escaping across ds_streamlit.py helpers, introduces a diagnostics_expander context manager, changes availability_badge to plain text, fixes humanize_id segment extraction, and refreshes design system docs. The CI workflow action pin is bumped in two places.

Changes

Design System Updates

Layer / File(s) Summary
CSS token and accessibility improvements
design-system/tokens.css, design-system/components.css
--font-body font stack reordered to system-ui-first with explicit sans-serif fallback; --font-heading relocated in .theme-paper. :focus-visible accent-color outline added for .ds interactive elements; prefers-reduced-motion: reduce disables skeleton shimmer animation.
ds_streamlit.py helper hardening and new context manager
design-system/ds_streamlit.py
Adds contextmanager and escape imports. empty_state and notice now HTML-escape all user-provided strings. translate_error lowercases exception text for case-insensitive matching. New diagnostics_expander @contextmanager wraps st.expander. availability_badge returns plain-text marker instead of HTML span. humanize_id extracts tail from the last colon-separated segment.
Docs and pattern formatting
design-system/README.md, design-system/PRESENTATION_PATTERNS.md
README heading drops "(staging)", adds ds_streamlit.py to the Files table, removes index.html/preview.html, and updates Status section to reference Workflows/templates/ distribution path. PRESENTATION_PATTERNS.md adds blank lines at P2, P3, P5, and P6 heading boundaries.

CI Workflow Action Pin Bump

Layer / File(s) Summary
agents-guard.yml action pin update
.github/workflows/agents-guard.yml
Updates the pinned commit SHA for stranske/Workflows/.github/actions/setup-api-client in both the pull_request_target and pull_request fallback "Setup API client" steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • stranske/Template#834: Modifies the same agents-guard.yml fallback "Setup API client" uses pin for stranske/Workflows/.github/actions/setup-api-client to a different commit hash, identical change pattern.
  • stranske/Template#849: Updates the same pinned uses revision for both fallback "Setup API client" steps in agents-guard.yml, directly overlapping with this PR's workflow change.
  • stranske/Template#841: Shares the same stranske/Workflows/.github/actions/setup-api-client commit SHA bump pattern in agents-guard.yml.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'chore: sync workflow templates' describes synchronizing workflow templates, which is only one aspect of this changeset that includes multiple design system files (CSS, Python, and Markdown documentation). Revise the title to reflect the full scope, such as 'chore: sync workflow templates and design system files' or 'chore: sync from stranske/Workflows (d0d4ad2)'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/workflows-d0d4ad2bdd25

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

@stranske-keepalive

stranske-keepalive Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: b810ebe
Latest Runs: ⏳ pending — Gate
Required: core tests (3.12): ⏳ pending, core tests (3.13): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 100.00%
Baseline 0.00%
Delta +100.00%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
src/my_project/__init__.py 100.0% 0

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@stranske
stranske temporarily deployed to agent-high-privilege June 23, 2026 08:30 — with GitHub Actions Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 @.github/workflows/agents-guard.yml:
- Line 114: Update the SHA reference for the setup-api-client action in both
fallback steps of the agents-guard workflow. Currently, both the fallback step
at line 114 and the fallback step at line 183 reference the outdated SHA
44965d8d784573c119fb63828c05c89256c5f3e1. Replace this SHA with the correct
synced version dfe0854ae9b1ba1c616e4b57fb498f283ea3216f in both occurrences
where the stranske/Workflows/.github/actions/setup-api-client action is used to
ensure the workflow applies the intended action bump in both event paths.

In `@design-system/ds_streamlit.py`:
- Around line 174-185: The functions availability_badge() and humanize_id() have
changed their output behavior in ways that break backward compatibility for
existing consumers of this shared module. For availability_badge(), add an
optional parameter to control whether HTML formatting is used (defaulting to the
original HTML format). For humanize_id(), add an optional parameter to control
segment selection behavior (defaulting to the original first-segment behavior).
This way, existing callers continue to work unchanged while new code can opt
into the updated behavior by passing the new parameter values.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ee6fb026-2be6-420f-a029-0c64a28ea001

📥 Commits

Reviewing files that changed from the base of the PR and between c9fd5f1 and e7a8a2a.

📒 Files selected for processing (6)
  • .github/workflows/agents-guard.yml
  • design-system/PRESENTATION_PATTERNS.md
  • design-system/README.md
  • design-system/components.css
  • design-system/ds_streamlit.py
  • design-system/tokens.css
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • stranske/Workflows (auto-detected)
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
.github/workflows/**/*.{yml,yaml}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

.github/workflows/**/*.{yml,yaml}: Ensure coverage threshold settings in GitHub Actions workflow files for coverage-min match the [tool.coverage.report] fail_under setting in pyproject.toml, as the lower value will be the effective threshold
For startup_failure in GitHub Actions workflows with zero jobs, check for invalid YAML syntax, top-level permissions: blocks in workflow_call reusable workflows (which conflicts with caller permissions), invalid permission scopes, or circular workflow references

Files:

  • .github/workflows/agents-guard.yml
.github/workflows/*.yml

📄 CodeRabbit inference engine (CLAUDE.md)

Reference reusable workflows with @main unless intentionally pinning to an exact commit SHA for a controlled reason

Files:

  • .github/workflows/agents-guard.yml
.github/workflows/**/*.yml

📄 CodeRabbit inference engine (AGENTS.md)

First-party consumers should reference reusable workflows with @main unless intentionally pinning to an exact commit SHA for a controlled reason

Files:

  • .github/workflows/agents-guard.yml
.github/workflows/agents-*.yml

📄 CodeRabbit inference engine (AGENTS.md)

Agent workflows (agents-*.yml), autofix.yml, synced prompts in .github/codex/, and synced scripts/docs should be fixed in stranske/Workflows, not in the consumer repository

Files:

  • .github/workflows/agents-guard.yml
**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

In Manager-Database repository using Prefect 2.x, import schedules from prefect.client.schemas.schedules rather than other locations

Files:

  • design-system/ds_streamlit.py
🪛 LanguageTool
design-system/README.md

[uncategorized] ~50-~50: The official name of this software platform is spelled with a capital “H”.
Context: ...m/and distributed by Maint 68 through.github/sync-manifest.yml`. Update it here firs...

(GITHUB)

🔀 Multi-repo context stranske/Workflows

Linked repositories findings

stranske/Workflows

Setup API Client Action Update [::stranske/Workflows::]

  • .github/actions/setup-api-client/action.yml — The PR updates the fallback pin in consumer workflows from commit 44965d8d784573c119fb63828c05c89256c5f3e1 to dfe0854ae9b1ba1c616e4b57fb498f283ea3216f (referenced in the git log as "fix: harden synced design system helpers #2511")
  • The action provides comprehensive API client setup with:
    • Support for multiple token types (PATs, GitHub App credentials)
    • Token load balancer exports to environment
    • npm @octokit dependency installation with retry logic
    • Machine-readable setup contract JSON output
  • The action signature and outputs remain backward-compatible; the update is to the pinned version

Design System Breaking Changes Synced to Consumers [::stranske/Workflows::]

The PR syncs design system files from commit dfe0854ae9b1ba1c616e4b57fb498f283ea3216f that contain breaking API changes for Streamlit applications:

  1. availability_badge() return type changedesign-system/ds_streamlit.py

    • Changed from: "<span class='badge'>Active</span>" (HTML element)
    • Changed to: " · Active" (plain text)
    • Impact: Consumer Streamlit apps rendering this with unsafe_allow_html=True will display unstyled plain text instead of a styled badge
    • Applications using this function will require updates to handle the new plain text format
  2. humanize_id() segment extraction logic changedesign-system/ds_streamlit.py

    • Changed from: Extracts first segment before colon (e.g., "user:12345:admin""user")
    • Changed to: Extracts last segment after colon (e.g., "user:12345:admin""admin")
    • Impact: Any Streamlit app using this function for ID display will show different (likely more granular) output
  3. New function: diagnostics_expander()design-system/ds_streamlit.py

    • Adds context manager: diagnostics_expander(label: str = "Diagnostics", *, expanded: bool = False)
    • Non-breaking; purely additive for collapsible diagnostics panels
  4. HTML escaping security enhancementdesign-system/ds_streamlit.py

    • empty_state() and notice() now escape user-provided strings before HTML rendering
    • Uses escape() from html module
    • Non-breaking security improvement; prevents HTML/script injection from user input
  5. Error handling case-insensitivitydesign-system/ds_streamlit.py

    • translate_error() now lowercases input and performs case-insensitive matching
    • Non-breaking improvement in robustness

CSS Accessibility Additions [::stranske/Workflows::]

  • design-system/components.css and design-system/tokens.css — Add :focus-visible outlines for keyboard navigation and @media (prefers-reduced-motion: reduce) rules for animation accessibility
  • These are non-breaking enhancements
  • Font stack updated in tokens.css with explicit sans-serif fallback

Design System Sync Configuration [::stranske/Workflows::]

  • .github/sync-manifest.yml — The manifest defines design-system as mode: update, meaning consumer repos will have their copies overwritten during sync
  • The breaking changes in ds_streamlit.py and the function signature changes will propagate to all synced consumer repositories, requiring any apps using these functions to be updated

Documentation Updates [::stranske/Workflows::]

  • design-system/PRESENTATION_PATTERNS.md — Updated with the presentation patterns standard (P1-P6) defining when and how to apply design-system patterns across the fleet
  • design-system/README.md — Updated to clarify that the design system is now managed from Workflows and distributed via maint-68 sync
🔇 Additional comments (5)
design-system/README.md (1)

1-1: LGTM!

The heading update (line 1), Files table entries (line 41), and status description (line 50) are all accurate and aligned with the upstream Workflows/templates/consumer-repo contract. The reference to .github/sync-manifest.yml correctly reflects the distribution mechanism documented in the PR objectives.

Also applies to: 41-41, 50-50

design-system/PRESENTATION_PATTERNS.md (1)

17-24: LGTM!

The formatting changes (blank lines and heading reflow) improve visual hierarchy and readability without altering substantive content. All pattern rules, fixes, and function signatures remain accurate and consistent with the referenced ds_streamlit.py helpers.

Also applies to: 33-33, 43-51, 60-60

design-system/tokens.css (1)

29-29: LGTM!

Also applies to: 74-74

design-system/components.css (1)

41-41: LGTM!

Also applies to: 97-99

design-system/ds_streamlit.py (1)

29-30: LGTM!

Also applies to: 93-99, 115-121, 137-149, 165-171

steps.eligibility.outputs.should-run == 'true' &&
steps.api_client_base.outputs.available != 'true'
uses: "stranske/Workflows/.github/actions/setup-api-client@62ed0a86b5d57062ac3d04f4519e3998858e2d96" # v1
uses: "stranske/Workflows/.github/actions/setup-api-client@44965d8d784573c119fb63828c05c89256c5f3e1" # v1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Update both fallback action pins to the synced SHA.

Both fallback steps still reference 44965d8d784573c119fb63828c05c89256c5f3e1, but this sync is expected to use dfe0854ae9b1ba1c616e4b57fb498f283ea3216f. As written, the workflow does not apply the intended action bump in either event path.

Suggested patch
-        uses: "stranske/Workflows/.github/actions/setup-api-client@44965d8d784573c119fb63828c05c89256c5f3e1" # v1
+        uses: "stranske/Workflows/.github/actions/setup-api-client@dfe0854ae9b1ba1c616e4b57fb498f283ea3216f" # v1
...
-        uses: "stranske/Workflows/.github/actions/setup-api-client@44965d8d784573c119fb63828c05c89256c5f3e1" # v1
+        uses: "stranske/Workflows/.github/actions/setup-api-client@dfe0854ae9b1ba1c616e4b57fb498f283ea3216f" # v1

Also applies to: 183-183

🤖 Prompt for 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.

In @.github/workflows/agents-guard.yml at line 114, Update the SHA reference for
the setup-api-client action in both fallback steps of the agents-guard workflow.
Currently, both the fallback step at line 114 and the fallback step at line 183
reference the outdated SHA 44965d8d784573c119fb63828c05c89256c5f3e1. Replace
this SHA with the correct synced version
dfe0854ae9b1ba1c616e4b57fb498f283ea3216f in both occurrences where the
stranske/Workflows/.github/actions/setup-api-client action is used to ensure the
workflow applies the intended action bump in both event paths.

Source: Linked repositories

Comment on lines 174 to +185
def availability_badge(label: str) -> str:
"""P5 — markup for a small availability marker (use in a tab title/caption),
"""P5 — plain Streamlit-safe availability marker for tab titles/captions,
e.g. tab label f"Export {availability_badge('multi-period only')}"."""
return f"<span class='ds-badge'>{label}</span>"
return f" · {str(label).strip()}"


def humanize_id(raw: str, mapping: Mapping[str, str] | None = None) -> str:
"""P6 — decode an internal id to a human label; never show raw keys."""
if mapping and raw in mapping:
return mapping[raw]
# Best-effort: take a trailing human-ish segment, strip hashes.
tail = str(raw).replace("_", " ").split(":")[0].strip()
tail = str(raw).replace("_", " ").split(":")[-1].strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve backward compatibility for exported helper behavior.

availability_badge() (HTML → plain text) and humanize_id() (first-segment → last-segment) both change public output contracts. In this synced shared module, that is a high-risk integration break for existing consumers expecting prior behavior. Keep old defaults and make new behavior opt-in (or introduce new helper names) to avoid downstream UI regressions.

Proposed compatibility-oriented patch
 def availability_badge(label: str) -> str:
-    """P5 — plain Streamlit-safe availability marker for tab titles/captions,
-    e.g. tab label f"Export {availability_badge('multi-period only')}"."""
-    return f" · {str(label).strip()}"
+    """P5 — availability marker.
+    Backward-compatible default returns styled HTML; plain text is opt-in."""
+    normalized = str(label).strip()
+    return f"<span class='ds-badge'>{escape(normalized)}</span>"
 
 
-def humanize_id(raw: str, mapping: Mapping[str, str] | None = None) -> str:
+def humanize_id(
+    raw: str,
+    mapping: Mapping[str, str] | None = None,
+    *,
+    use_trailing_segment: bool = False,
+) -> str:
     """P6 — decode an internal id to a human label; never show raw keys."""
     if mapping and raw in mapping:
         return mapping[raw]
-    # Best-effort: take a trailing human-ish segment, strip hashes.
-    tail = str(raw).replace("_", " ").split(":")[-1].strip()
+    # Backward-compatible default keeps first segment unless explicitly overridden.
+    parts = str(raw).replace("_", " ").split(":")
+    tail = (parts[-1] if use_trailing_segment else parts[0]).strip()
     return tail or "item"
🤖 Prompt for 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.

In `@design-system/ds_streamlit.py` around lines 174 - 185, The functions
availability_badge() and humanize_id() have changed their output behavior in
ways that break backward compatibility for existing consumers of this shared
module. For availability_badge(), add an optional parameter to control whether
HTML formatting is used (defaulting to the original HTML format). For
humanize_id(), add an optional parameter to control segment selection behavior
(defaulting to the original first-segment behavior). This way, existing callers
continue to work unchanged while new code can opt into the updated behavior by
passing the new parameter values.

Source: Linked repositories

@stranske

Copy link
Copy Markdown
Owner Author

Closing as superseded by newer sync PR #856 from the latest Workflows sync wave.

@stranske stranske closed this Jun 23, 2026
@stranske
stranske deleted the sync/workflows-d0d4ad2bdd25 branch June 23, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Automated sync from Workflows sync Automated sync from Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant