Skip to content

test: put in some bad stuff to test sonarqube - #388

Open
hatwell wants to merge 1 commit into
masterfrom
task/NPA-7116/testing
Open

test: put in some bad stuff to test sonarqube#388
hatwell wants to merge 1 commit into
masterfrom
task/NPA-7116/testing

Conversation

@hatwell

@hatwell hatwell commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Pull Request

🧾 Ticket Link

https://nhsd-jira.digital.nhs.uk/browse/NPA-7116


📄 Description/Summary of Changes

  • Testing sonarqube's ability to flag issues in code

🧪 Developer Testing Carried Out


📋 PR Principles

  • Keep PRs Small and Focused: Ensure the PR addresses a single task or feature to make it easier to review.
  • Multiple PRs for one Ticket: When splitting work into multiple PRs, clearly describe what this PR addresses and outline the remaining work to complete the ticket.
  • Ensure Tests Are Included: Add or update unit, integration, or end-to-end tests to cover the changes made.
  • Follow Coding Standards: Ensure the code adheres to the team's coding guidelines and best practices.
  • Resolve Comments Promptly: If you raise a comment, ensure you follow up and resolve it before approving the PR to maintain clarity and ensure comments are addressed.
  • Foster Learning: PR reviews are an opportunity to share knowledge, provide constructive feedback, and encourage a collaborative environment.

🏷️ Naming Conventions Reminder

Please ensure the following naming conventions are followed:

  • PR title follows the format: NPA-XXXX: <short-description>
  • Branch name follows the convention: <type>/NPA-XXXX/<short-description>
  • Commit messages follow the template: NPA-XXXX: <short-description>

Copilot AI lite review requested due to automatic review settings August 20, 2026 13:57

Copilot AI left a comment

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.

Pull request overview

This PR introduces deliberately “bad” patterns intended to test SonarQube’s ability to detect issues within the sandbox API codebase and its unit tests.

Changes:

  • Adjusted assertion operand ordering in two sandbox API test modules.
  • Added a hard-coded token constant to sandbox/api/constants.py.

Reviewed changes

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

File Description
sandbox/api/tests/test_patch_consent.py Reordered a JSON equality assertion in the PATCH consent test.
sandbox/api/tests/test_get_questionnaire_response_by_path_id.py Reordered a status code assertion in the QuestionnaireResponse GET test.
sandbox/api/constants.py Added a new constant containing a hard-coded token.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sandbox/api/constants.py Outdated
Comment thread sandbox/api/tests/test_get_questionnaire_response_by_path_id.py Outdated
Comment thread sandbox/api/tests/test_patch_consent.py Outdated
@hatwell
hatwell force-pushed the task/NPA-7116/testing branch from 1a73ecd to cc01280 Compare August 20, 2026 14:43
@sonarqubecloud

Copy link
Copy Markdown

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