Skip to content

Fix incorrect page number in check results URL and update related tes… - #1206

Merged
gibahjoe merged 1 commit into
mainfrom
fix/wrong-page-number-in-check-results
Jun 11, 2026
Merged

Fix incorrect page number in check results URL and update related tes…#1206
gibahjoe merged 1 commit into
mainfrom
fix/wrong-page-number-in-check-results

Conversation

@gibahjoe

@gibahjoe gibahjoe commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the Check Tool link added to Jira service request descriptions so it always points to the first results page (/check/results/:requestId/1) instead of incorrectly using the Jira requestTypeId as the page number. Adds regression coverage to keep the results page number and Jira request type separate.

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Related Tickets & Documents

  • Closes #

QA Instructions, Screenshots, Recordings

Run:

npx vitest run test/unit/checkAnswersController.test.js
test/unit/checkAnswersController.test.js

Verify that Jira request descriptions now include a Check Tool link like:

/check/results/<request-id>/1

and not:

/check/results/<request-id>/<jira-request-type-id>

Before

Check Tool links in Jira descriptions could point to page 28 because config.jira.requestTypeId was used as the results page number.

After

Check Tool links point to page 1, while config.jira.requestTypeId is still passed separately to Jira when creating the service request.

Added/updated tests?

  • Yes
  • No, and this is why:
  • I need help with writing tests

QA sign off

  • Code has been checked and approved
  • Design has been checked and approved
  • Product and business logic has been checked and proved

[optional] Are there any post-deployment tasks we need to perform?

None.

[optional] Are there any dependencies on other PRs or Work?

None.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the format of Check Tool links in Jira service request descriptions.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3bece4ea-d90f-4085-94cd-9a898206d6b6

📥 Commits

Reviewing files that changed from the base of the PR and between c85cbb2 and e8a32a3.

📒 Files selected for processing (2)
  • src/controllers/CheckAnswersController.js
  • test/unit/checkAnswersController.test.js

Walkthrough

The PR changes the Jira service request "Check Tool" URL generation from using a configurable requestTypeId to a hard-coded /1 path segment. Test setup values are updated to '28' to isolate the configuration from the hard-coded URL value, with new assertions confirming the URL contains /1 and does not contain the configured ID.

Changes

Check Tool URL Hard-Coding

Layer / File(s) Summary
Hard-coded Check Tool URL segment
src/controllers/CheckAnswersController.js
The "Check Tool" results URL template in createJiraServiceRequest switches from using ${config.jira.requestTypeId} to a fixed /1 path segment in the Jira service request description.
Test setup and URL behaviour validation
test/unit/checkAnswersController.test.js
Test configuration config.jira.requestTypeId is set to '28' instead of '1', and new assertions verify that the generated Jira description contains the hard-coded /1 segment whilst not containing the path built from the configured requestTypeId. Additional geometry and CSV attachment test cases are updated to run with the new configuration value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • digital-land/submit#1078: Both PRs modify CheckAnswersController.createJiraServiceRequest to generate the "check tool" URL embedded in the Jira ticket description, with the main PR changing the URL's request-type/trailing segment logic.

Suggested labels

bug

Suggested reviewers

  • DilwoarH
  • Ben-Hodgkiss

Poem

🐰 A URL that once danced with config's request ID,
Now stands firm with /1, tried and true,
The tests confirm it—hard-coded, not free,
Where /28/ once lived, our checks break through! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarises the main change: fixing an incorrect page number in the check results URL. It directly corresponds to the primary modification in the changeset where the Check Tool URL now uses a fixed '/1' instead of the Jira requestTypeId.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wrong-page-number-in-check-results

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 66.2% 7122 / 10758
🔵 Statements 66.2% 7122 / 10758
🔵 Functions 63.37% 289 / 456
🔵 Branches 77.45% 993 / 1282
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/controllers/CheckAnswersController.js 87.5% 70.37% 100% 87.5% 17-19, 23-29, 153-159, 166, 183-188
Generated in workflow #1501 for commit e8a32a3 by the Vitest Coverage Report Action

@gibahjoe
gibahjoe merged commit 14a3d5b into main Jun 11, 2026
7 of 8 checks passed
@gibahjoe
gibahjoe deleted the fix/wrong-page-number-in-check-results branch June 11, 2026 14:47
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.

2 participants