Skip to content

OTWO-7640 Ignore-files ui silently discards input exceeding 1000 chars#1896

Open
Niharika1117 wants to merge 4 commits into
mainfrom
OTWO-7640
Open

OTWO-7640 Ignore-files ui silently discards input exceeding 1000 chars#1896
Niharika1117 wants to merge 4 commits into
mainfrom
OTWO-7640

Conversation

@Niharika1117
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses the “ignore-files” UI issue where input exceeding 1000 characters was silently discarded, by surfacing validation errors instead of always redirecting after update.

Changes:

  • Adds/updates model validation messaging for Enlistment#ignore length (max 1000 chars).
  • Updates EnlistmentsController#update to render the edit form on validation failure instead of always redirecting.
  • Adds model tests covering ignore length boundary behavior and expected error messaging.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
app/controllers/enlistments_controller.rb Render edit view on failed update to preserve input and show validation errors.
app/models/enlistment.rb Customizes ignore length validation message at 1000 characters.
test/models/enlistment_test.rb Adds specs for ignore validation boundary conditions and error message expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/controllers/enlistments_controller.rb
Comment thread app/controllers/enlistments_controller.rb Outdated
Comment thread app/models/enlistment.rb Outdated
Comment thread test/models/enlistment_test.rb Outdated
Comment thread app/controllers/enlistments_controller.rb
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +50 to +55
if @enlistment.update(enlistment_params)
@enlistment.project.schedule_delayed_analysis(3.minutes)
redirect_to project_enlistments_path(@project), flash: { success: t('.success') }
else
render :edit, status: :unprocessable_entity
end
Comment thread app/controllers/enlistments_controller.rb
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