Skip to content

refactor: clear the SonarCloud findings on Bloom - #118

Merged
elomariamin merged 18 commits into
mainfrom
dev
Oct 20, 2026
Merged

elomariamin merged 18 commits into
mainfrom
dev

Conversation

@elomariamin

@elomariamin elomariamin commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Clears the code-fixable SonarCloud findings on Bloom in fifteen commits, with no change to API schemas or visible UI beyond label associations and documented response statuses.

Validation

  • I added or updated tests where appropriate.
  • I ran the relevant checks from .github/workflows/ci-cd.yml.
  • I documented user-visible or operational changes.

Third-party material

  • This contribution contains no third-party code or assets that I have not identified.
  • I documented every applicable third-party licence and attribution requirement.

Contributor License Agreement

  • I have read and accept CLA.md, version 1.0, as stored in this repository at the time of this pull request. I confirm that I have the authority to submit this contribution and grant the rights described there.

Submitting this pull request does not guarantee acceptance. Contributions without the checked CLA declaration will not be merged.

Add the statuses raised by the routes or by the helpers they call to the
route decorators' responses, with the HTTPStatus phrase descriptions of
app/api/tags.py:
- test-report publishing: 413, 422
- document type summary and next document id: 404
- GitHub, GitLab and Jira webhooks: 404, 413, 429
- project member read and removal: 404
- service credential creation: 422
- test case creation: 400; test case update: 404
- suite item addition: 400, 404
- email change start: 400, 404, 503; approval: 404, 503; rejection: 404
Declare the database session and current user dependencies of the setup
status, first administrator and dashboard statistics routes with
Annotated type hints, and drop the response_model arguments of the two
setup routes whose return annotations name the same models.
ClassifiedSection.type_code, MarkdownImportResult.doc_type and
TestCaseResponse.steps are typed T | None without a default; they stay
required and nullable.
Remove the unused project_id of customer_only, the unused db of
is_customer_only and its project_id, which only fed customer_only, the
unused current_user of external_doc_type_allowed, the unused db of
_registry_union and the unused allowed_doc_types and permissions of
link_end, and update their callers and the entitlement test.

is_customer_only, _registry_union and _build_tc_response are plain
functions and their callers call them without await. The link_end
callers keep awaiting get_external_doc_types at the same point and no
longer compute effective_permissions; the imports left unused are
removed.
Build the request models, uploads, users, coroutines and savepoints
before the pytest.raises blocks of the policy, lookup, auth, logo,
image release, Markdown import, notification, project variable, ReqIF,
tag link, link rule and project access tests; each block holds only
the call under test.
Replace every [ ] test with [[ ]] in the Cloudron and image smoke
scripts and read the json_field argument into a local named field.
Write the nested conditional expressions of the policy rule validation,
the project access origin group and the access map policy selection as
if/else statements, compute the known document types of the access map
in a local before the merged term is built, invert the empty branch of
the document lookup by kind slug, and merge the nested ReqIF root checks
into one condition.
Build the imported test case arguments and the PostgreSQL pool options as
dict literals, the section counts and verify link counts with dict(), the
zero counters with dict.fromkeys, the document id pattern with \d and
re.ASCII, and the project prefix error as one string literal.
Write the nested conditional expressions of 31 UI files as named helper
functions with if statements, lookup maps or one conditional block per
case: date field text and day classes, tracker settings and pull hint,
role badge, sort icons, topology edge colours, policy sources and
summaries, report request and save labels, workflow comments and
revisions, toolbar classes, mention suggestions, cached project lookup,
artefact form text and tracker names, audit sort direction, document
status choices and field controls, empty document list texts, policy
editor toggles and tab keys, import wizard steps, email change hints,
the loading, empty and list states of the list pages, and the coverage
colour tiers, which share percentTone in ui/src/lib/percentTone.ts.
Give the 46 form labels of the invitation, artefact edit, baseline,
defect, forgot password, login, project edit, parameter, project,
reset password, setup, suite edit, campaign, suite and user forms an
htmlFor pointing at a matching id on their input, textarea or select
field.
Mark the beaker icons of the sidebar and the project page and the close
icon of the outline sidebar aria-hidden, and write the label texts next
to their checkboxes and inputs in the tracker settings, parameter
collision, policy, import and project deletion forms on the same line
as the input, keeping the rendered text nodes.
Call Number.parseInt in the outline navigation and the campaign,
requirement and test case pages; keep the public paths and the granted
project and application actions in sets read with has(); build the
mention pattern with String.raw; push the two campaign and suite
breadcrumbs in one call each; match typed dates with RegExp.exec; find
the access tab with indexOf over a views array typed as the view union;
and sort a copy of the document sections in the section list.
Merge the duplicate react, @tiptap/react and react-router imports of the
layout, editor and login; build the notification label, document list
links and related filter chip without nested template literals; drop
the unused update arguments and their void statements in the
integration, parameter and user mutations; use optional chaining for
the tag query and the one-time token hash, ??= for the shared token
refresh, throw in the response interceptor, a plain spread of the Jira
priority map, string for the document kind parameter and error_ for the
attachment download catch parameter.
Remove the single-child fragments of the artefact, campaign, document,
requirement, suite and test case pages and of the defect resolution
field; build the parameter mention popup with the shared mention
renderer, which takes a trigger suffix; memoize the auth and page meta
provider values, with login and logout in useCallback and the page meta
setter named after its state; and define the defect and document
SortHeader components at module level with the sort state passed as
props.
Query the new project button with getByRole in its presence assertion,
assert the defect list call count with toHaveLength on the mock calls,
and run the five one-time token reading cases through it.each with
their existing names.
constraints.txt regenerated with pip-compile, upgrading only fastapi
0.142.2 to 0.153.0 and starlette 1.7.0 to 1.9.0, and adding
opentelemetry-api 1.45.1, a fastapi dependency.
formText in ArtefactDetail.tsx returns JSON for object values and
String for other non-null values.
formText returns strings unchanged, String for numbers, booleans and
bigints, JSON for other values, and an empty string for null.
@sonarqubecloud

Copy link
Copy Markdown

@elomariamin
elomariamin merged commit 1e312c6 into main Oct 20, 2026
10 checks passed
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.

1 participant