Skip to content

Update dependencies, enhance accessibility, and add regression specs - #480

Merged
rsmoke merged 13 commits into
mainfrom
staging
Oct 21, 2026
Merged

rsmoke merged 13 commits into
mainfrom
staging

Conversation

@rsmoke

@rsmoke rsmoke commented Oct 21, 2026

Copy link
Copy Markdown
Member

This pull request introduces several improvements and fixes across the codebase, focusing on enhancing the reliability of room deactivation logic, improving modal accessibility and UI, refining logging and API error handling, and adding comprehensive test coverage for critical components. The most significant changes are grouped below.

Room Deactivation Logic Improvements:

  • Updated the deactivate_stale_rooms method in both lib/buildings_api.rb and lib/classroom_api.rb to correctly count already hidden rooms as deactivated, ensure only visible or unset rooms are updated, and improve transaction rollback and logging for mismatches. This ensures more accurate and robust handling of room visibility state. [1] [2]
  • Added and expanded tests in spec/lib/buildings_api_spec.rb and spec/lib/classroom_api_spec.rb to verify that deactivation hides rooms without deleting related records or media, correctly handles already hidden or unset rooms, and properly rolls back on errors. [1] [2] [3]

Modal Accessibility and UI Enhancements:

  • Refactored the support info modal in app/views/rooms/_support_info.html.erb to use the native <dialog> element, improving accessibility with proper ARIA attributes and more semantic structure. Also updated the trigger in app/views/rooms/_room_row.html.erb to use a button instead of a link for better accessibility and interaction. [1] [2] [3]

Logging and API Error Handling:

  • Improved error logging in lib/auth_token_api.rb to include detailed error messages when saving logs fails.
  • Added a test in spec/lib/api_update_database/runner_spec.rb to ensure that token acquisition failures halt subsequent phases and that phase errors are logged and reported correctly.

Test Coverage and Utilities:

  • Added comprehensive specs for ApiUpdateDatabase::PhaseResult and ApiUpdateDatabase::RunResult to ensure correct behavior for incrementing counters, error/warning handling, duration calculation, and structured log serialization. [1] [2]
  • Added tests for helper methods in spec/helpers/application_helper_spec.rb to verify correct API status and log text reporting.

Other Small Improvements:

  • Allowed a small clock drift for SAML assertions in Devise configuration to improve authentication robustness.
  • Updated the Tailwind CSS watcher command in Procfile.dev for improved development experience.

rsmoke and others added 12 commits October 14, 2026 11:35
…d, and enhance support info modal with improved accessibility and styling.
Cover department lookup success/failure shaping used by BuildingsApi room
updates, and ensure Sentry metric failures are swallowed so jobs/rake keep
running.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: rsmoke <rsmoke@umich.edu>
…463)

Cover the success path that hides rooms via visible=false while keeping
contacts, characteristics, and Active Storage panoramas/images, plus the
already-hidden fail-closed invariant in BuildingsApi and ClassroomApi.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: rsmoke <rsmoke@umich.edu>
Cover structured phase/run reporting and runner early-exit when auth
token acquisition fails, so nightly classroom sync failures stay
visible in ApiUpdateLog without continuing later phases.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: rsmoke <rsmoke@umich.edu>
…ory (#465)

Bumps the bundler group with 1 update in the / directory: [rubyzip](https://github.com/rubyzip/rubyzip).


Updates `rubyzip` from 3.2.2 to 3.4.0
- [Release notes](https://github.com/rubyzip/rubyzip/releases)
- [Changelog](https://github.com/rubyzip/rubyzip/blob/main/Changelog.md)
- [Commits](rubyzip/rubyzip@v3.2.2...v3.4.0)

---
updated-dependencies:
- dependency-name: rubyzip
  dependency-version: 3.4.0
  dependency-type: indirect
  dependency-group: bundler
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rsmokeUM <rsmoke@umich.edu>
…#467)

* Add TaskResultLog, TokenStore, and Okta display_name regression specs

Cover nightly API update logging status/payload persistence, token
cache expiry and failure paths, and Okta SAML display_name mapping on
omniauth callback so auth/name regressions are caught early.

Co-authored-by: rsmoke <rsmoke@umich.edu>

* Improve error logging in ApiUpdateLog by including detailed error messages when save fails.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: rsmoke <rsmoke@umich.edu>
* Add ApplicationHelper api_status and api_log_text regression specs.

Cover the admin header banner signals for missing nightly runs, error vs success
recency, and blank log fallback so false-positive or missed API failure alerts
are less likely to regress.

Co-authored-by: rsmoke <rsmoke@umich.edu>

* Potential fix for pull request finding 'Test does not verify log recency filtering'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: rsmoke <rsmoke@umich.edu>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Add FloorPolicy authorization regression specs.

Lock viewer show vs admin mutation permissions and deny show when
membership groups are empty outside production.

Co-authored-by: rsmoke <rsmoke@umich.edu>

* Improve error logging in TaskResultLog specs by including specific error messages for invalid records

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: rsmoke <rsmoke@umich.edu>
Lock admin-only index/show/refresh gates so non-admin viewers cannot
access API update logs or refresh the analytics dashboard.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: rsmoke <rsmoke@umich.edu>
Co-authored-by: rsmokeUM <rsmoke@umich.edu>
A stale classroom that was already hidden aborted the rooms phase and skipped the rest of the update.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 20:31

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.

🔵 Needs a closer look

Dependency, SAML, and browser-dialog changes need human integration validation before approval.

No open issues 🎉

What changed in this PR

Improves room synchronization reliability and support-dialog accessibility in the Rails application, with broader regression coverage.

Changes:

  • Handles hidden and unset room visibility correctly and improves failure logging.
  • Introduces native dialog markup, updates dependencies and styling, and allows SAML clock drift.
  • Expands tests for APIs, authentication, authorization, metrics, and reporting.
File Description
spec/​services/​sentry_metrics_spec.rb Tests metric forwarding and failure handling.
spec/​requests/​users/​omniauth_callbacks_spec.rb Tests SAML display-name persistence.
spec/​policies/​floor_policy_spec.rb Tests floor access permissions.
spec/​policies/​api_update_log_policy_spec.rb Tests log access permissions.
spec/​policies/​analytics_dashboard_policy_spec.rb Tests dashboard permissions.
spec/​lib/​um_api_spec.rb Tests token expiry and failures.
spec/​lib/​task_result_log_spec.rb Tests structured logging and save failures.
spec/​lib/​department_api_spec.rb Tests department API responses.
spec/​lib/​classroom_api_spec.rb Tests classroom deactivation and preservation.
spec/​lib/​buildings_api_spec.rb Tests room deactivation and rollback.
spec/​lib/​api_update_database/​runner_spec.rb Tests token and phase failures.
spec/​lib/​api_update_database/​run_result_spec.rb Tests run-result serialization.
spec/​lib/​api_update_database/​phase_result_spec.rb Tests phase counters and reporting.
spec/​helpers/​application_helper_spec.rb Tests API status and log helpers.
Procfile.dev Keeps the CSS watcher running.
lib/​classroom_api.rb Handles hidden and unset classrooms.
lib/​buildings_api.rb Handles hidden and unset rooms.
lib/​auth_token_api.rb Logs actual validation errors.
Gemfile.lock Updates Rubyzip and Tailwind dependencies.
config/​initializers/​devise.rb Allows ten seconds of SAML clock drift.
app/​views/​rooms/​_support_info.html.erb Uses native dialog markup and unique labels.
app/​views/​rooms/​_room_row.html.erb Uses a button to open support information.
app/​assets/​builds/​tailwind.css Regenerates styles with dialog utilities.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 21, 2026 20:36

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.

🟡 Changes recommended

Concurrent visibility changes can cause false count mismatches and roll back deactivation in both importers.

1 open issue

Review effort: Balanced

Comment thread lib/buildings_api.rb
Comment on lines +437 to +438
already_hidden_count = Room.where(rmrecnbr: room_ids, visible: false).count
deactivated_count = Room.where(rmrecnbr: room_ids, visible: [true, nil]).update_all(visible: false)
@rsmoke
rsmoke merged commit ecba528 into main Oct 21, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
staging — 3419bf80 Deployed Oct 21, 2026 by hatchbox-io[bot]
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