Skip to content

Support file upload for accessibility reports#744

Open
rhigman wants to merge 14 commits intodevelopfrom
feature/a11y_report_upload
Open

Support file upload for accessibility reports#744
rhigman wants to merge 14 commits intodevelopfrom
feature/a11y_report_upload

Conversation

@rhigman
Copy link
Copy Markdown
Member

@rhigman rhigman commented Apr 15, 2026

No description provided.

@rhigman rhigman marked this pull request as draft April 16, 2026 13:48
@rhigman rhigman marked this pull request as ready for review April 20, 2026 14:52
@rhigman rhigman requested a review from ja573 April 20, 2026 14:52
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c3c40989e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

(file_type = 'publication' AND publication_id IS NOT NULL AND work_id IS NULL AND additional_resource_id IS NULL AND work_featured_video_id IS NULL) OR
(file_type = 'additional_resource' AND additional_resource_id IS NOT NULL AND work_id IS NULL AND publication_id IS NULL AND work_featured_video_id IS NULL) OR
(file_type = 'work_featured_video' AND work_featured_video_id IS NOT NULL AND work_id IS NULL AND publication_id IS NULL AND additional_resource_id IS NULL) OR
(file_type = 'accessibility_report' AND publication_id IS NOT NULL AND work_id IS NULL AND additional_resource_id IS NULL AND work_featured_video_id IS NULL)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Enforce one accessibility report file per publication

This migration adds accessibility_report to the file checks but does not add a matching partial unique index on file(publication_id) for that new file_type. The application path reads by publication with .first() (File::from_publication_id), so concurrent/retried completions can create duplicate accessibility-report rows and then return/update an arbitrary one, leaving stale records and object keys behind. Please add a unique index equivalent to file_publication_unique_idx, filtered to file_type = 'accessibility_report'.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac01c6bf59

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +8 to +10
ADD CONSTRAINT file_type_check
CHECK (
(file_type = 'frontcover' AND work_id IS NOT NULL AND publication_id IS NULL AND additional_resource_id IS NULL AND work_featured_video_id IS NULL) OR
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Purge new file rows before restoring old file_type checks

This rollback can fail in any environment that has already accepted an accessibility_report upload: the down migration re-adds file_type_check/file_upload_type_check without allowing accessibility_report, but it does not delete or migrate existing rows of that type first. In that case, ALTER TABLE ... ADD CONSTRAINT errors and blocks rollback; add a cleanup step for file and file_upload rows with file_type = 'accessibility_report' before recreating the old constraints.

Useful? React with 👍 / 👎.

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