Skip to content

fix: ensure the ServiceNow case ID matches the expected pattern#1590

Merged
chrimesdev merged 3 commits intomainfrom
fix/form-validation
Sep 3, 2025
Merged

fix: ensure the ServiceNow case ID matches the expected pattern#1590
chrimesdev merged 3 commits intomainfrom
fix/form-validation

Conversation

@chrimesdev
Copy link
Copy Markdown
Member

@chrimesdev chrimesdev commented Sep 3, 2025

Description

This PR fixes the validation pattern for ServiceNow case IDs to enforce a more specific format requirement. The validation now requires case IDs to start with exactly two letters followed by at least seven digits.

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@chrimesdev chrimesdev requested a review from Copilot September 3, 2025 13:11
Copy link
Copy Markdown
Contributor

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 fixes the validation pattern for ServiceNow case IDs to enforce a more specific format requirement. The validation now requires case IDs to start with exactly two letters followed by at least seven digits, replacing the previous more permissive validation that only required 9+ alphanumeric characters.

  • Updated validation schema to enforce the pattern of two letters followed by at least seven digits
  • Simplified validation logic by consolidating multiple refinement checks into a single regex pattern
  • Updated all corresponding test cases and error messages to reflect the new format requirement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
formValidationSchemas.ts Updated ServiceNow case ID validation to require two letters followed by at least seven digits
formValidationSchemas.test.ts Updated test cases and expected error messages to match the new validation pattern

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread application/CohortManager/src/Web/app/lib/formValidationSchemas.ts Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 3, 2025

Unit Test Results

✔️ Tests 777 / 777 - passed in 64.3s
📝 Coverage 56.94%
📏 4285 / 7411 lines covered 🌿 1055 / 1968 branches covered
🔍 click here for more details

✏️ updated for commit 0c21bf3

@chrimesdev chrimesdev enabled auto-merge September 3, 2025 13:25
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Sep 3, 2025

@chrimesdev chrimesdev added this pull request to the merge queue Sep 3, 2025
Merged via the queue into main with commit 898af83 Sep 3, 2025
65 checks passed
@chrimesdev chrimesdev deleted the fix/form-validation branch September 3, 2025 15:49
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