Skip to content

Conversation

@DanielTOsborne
Copy link

Use the BLOB/CLOB ID in the query if it contains invalid characters for all respective methods.

Dependency: USACE/cwms-data-api#1483
Required for: HydrologicEngineeringCenter/cwms-cli#72

Copy link
Collaborator

@Enovotny Enovotny left a comment

Choose a reason for hiding this comment

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

fix the sonar qube warnings. Just remove the f"" from standard strings..

@Enovotny
Copy link
Collaborator

@DanielTOsborne Make sure to run the code checks and reformate. steps are in the contributing file using poetry pre commit. it will reformate everything to Black.

@DanielTOsborne
Copy link
Author

@DanielTOsborne Make sure to run the code checks and reformate. steps are in the contributing file using poetry pre commit. it will reformate everything to Black.

Does that run on Windows? I tried to run the poetry tests, but get 11 failed and 40 errors with the main branch without my changes.

@Enovotny
Copy link
Collaborator

Enovotny commented Dec 4, 2025

you can't run the CDA tests on windows (poetry run pytest tests/). Those tests require a local instance of CDA and the cwms database to be running. I should update the readme for that.

You can run

poetry run mypy --strict cwms/

which relates to the errors you are getting in [Testing / run-tests (pull_request)]

and

poetry run pre-commit install
poetry run pre-commit run

which will reformat your changes to black. and are related to the errors your are getting in [Code Check / check-code]

I am not sure why the integration-tests are failing within github itself. Those are the ones that user actual CDA calls itself. seems to be a resource issue with github that I need to figure out. So ignore those at the moment.

@krowvin
Copy link
Collaborator

krowvin commented Dec 5, 2025

I am not sure why the integration-tests are failing within github itself.

It looks like from the logs that the github action ran out of storage

This says it is only 10GB for the actions runners
https://docs.github.com/en/actions/reference/limits#storage-limits-for-all-github-hosted-runners

We might be able to do this as a middle-step / bandaid until something more permanent can be done. (Trigger job on nebula for larger tests with oracle?)

- name: Free up disk space
  run: |
    docker system prune -af || true
    df -h

before the poetry installs run, but if it prunes the images we need for that run. Out of luck! Was mostly thinking we could remove the schema installer image

image: ghcr.io/hydrologicengineeringcenter/cwms-database/cwms/schema_installer:latest-dev

@MikeNeilson may have some thoughts too

@MikeNeilson
Copy link

Do this to clean up space: https://github.com/USACE/cwms-data-api/pull/1498/files#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721R27

@DanielTOsborne DanielTOsborne force-pushed the enhancements/blob-clob-query branch from 191720a to f5a5d78 Compare December 5, 2025 19:48
@DanielTOsborne
Copy link
Author

The None warning in SonarQube appears to be a false positive. clob_id can't be None due to the exception raised on line 136, and the assignment from the dictionary on line 139.

@Enovotny
Copy link
Collaborator

Enovotny commented Dec 5, 2025

The None warning in SonarQube appears to be a false positive. clob_id can't be None due to the exception raised on line 136, and the assignment from the dictionary on line 139.

it could if none is passed in with the json under ID. It is saying is needs a explicit call of if not None.. Then do the rest of the code. otherwise give an error.

@DanielTOsborne
Copy link
Author

Is there a way to run SonarQube locally?

@MikeNeilson
Copy link

MikeNeilson commented Dec 5, 2025

Is there a way to run SonarQube locally?

Yes, though I haven't done it for python, you'll likely need to pip install sonar or something and setup a sonar cloud account (I just have mine through github) and setup a token.

And if you're using VS Code there's an extension that integrates fairly nicely with Sonar to show results either overall or for just the PR changes.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
70.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@DanielTOsborne
Copy link
Author

I'll note that the tests I added won't all pass until USACE/cwms-data-api#1498 is merged and a new image is built.

@DanielTOsborne DanielTOsborne marked this pull request as draft December 11, 2025 23:10
@DanielTOsborne
Copy link
Author

Drafting until the CDA PR is merged.

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.

4 participants