Skip to content

Y26-105 - [PR] [Bug] useq_wafer dead-letters on ware-prod#5650

Open
yoldas wants to merge 5 commits intodevelopfrom
y26-105-bug-useq_wafer-dead-letters-on-ware-prod
Open

Y26-105 - [PR] [Bug] useq_wafer dead-letters on ware-prod#5650
yoldas wants to merge 5 commits intodevelopfrom
y26-105-bug-useq_wafer-dead-letters-on-ware-prod

Conversation

@yoldas
Copy link
Copy Markdown
Member

@yoldas yoldas commented Mar 30, 2026

Closes #

Changes proposed in this pull request

  • Added descriptor input validation in Descriptor#validate_value for required fields and Date values (YYYY-MM-DD, real date, sane year range).
  • Updated Tasks::SetDescriptorsHandler::Handler to validate descriptor inputs before processing and return validation errors.
  • Updated WorkflowsController#stage redirect logic so users stay on the same task page when validation fails (instead of being sent to the batch page).
  • Added/updated tests in descriptor_spec.rb and handler_spec.rb.

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@yoldas yoldas linked an issue Mar 30, 2026 that may be closed by this pull request
4 tasks
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.26%. Comparing base (a71005e) to head (623db61).
⚠️ Report is 26 commits behind head on develop.

Files with missing lines Patch % Lines
app/models/descriptor.rb 94.11% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5650      +/-   ##
===========================================
+ Coverage    87.24%   87.26%   +0.02%     
===========================================
  Files         1461     1461              
  Lines        33022    33052      +30     
  Branches      3475     3482       +7     
===========================================
+ Hits         28809    28842      +33     
+ Misses        4192     4189       -3     
  Partials        21       21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@BenTopping BenTopping left a comment

Choose a reason for hiding this comment

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

Changes look okay, just a question about moving the validation to the models.

belongs_to :task
serialize :selection, coder: YAML

DATE_YEAR_MIN = 1990
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.

Is this to stop cases like the dead letter where we have 62026 as the year?

end

def perform
errors = validate_descriptor_inputs
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.

Suggestion: Can we use rails validations here. Make use of the active record errors behaviour and add errors to the task model by running task.valid?. You would need to set validations on descriptor too for this to work I think.

# Returns an array of validation errors for the submitted descriptor value.
# The value comes from the Task Details form for a workflow task on a batch.
# @return [Array] An array of error messages, empty if the value is valid
def validate_value(submitted_value)
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.

Suggestion: Can you move these to active model validations so you can call descriptor.valid?

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.

Y26-105 - [Bug] useq_wafer dead-letters on ware-prod

2 participants