Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SeaLights integration files and deps. Configure SonarCloud inclusions/exclusions #1533

Merged

Conversation

jgarciao
Copy link
Contributor

@jgarciao jgarciao commented Jun 14, 2024

  • Adds files and dependencies needed to run the Sealights Listener for Intelligent Test Selection.
  • Configures SonarCloud inclusions/exclusions in order to ignore the sealights scripts and the pipeline samples, which have replicated code
  • Increases the timeout in Wait For RHODS Dashboard To Load, as the Sealights agent can slow down a little the Dashboard
  • Tested successfully in rhods-smoke/5797

return int(dt_value.timestamp() * 1000)

def extract_sl_endpoint(self):
payload = jwt.decode(self.token, algorithms=["RS512"], options={"verify_signature": False})

Check failure

Code scanning / SonarCloud

JWT should be signed and verified

<!--SONAR_ISSUE_KEY:AZAXTWshoQrHf9zGkb5a-->Don't use a JWT token without verifying its signature. <p>See more on <a href="https://sonarcloud.io/project/issues?id=red-hat-data-services_ods-ci&issues=AZAXTWshoQrHf9zGkb5a&open=AZAXTWshoQrHf9zGkb5a&pullRequest=1533">SonarCloud</a></p>
return int(dt_value.timestamp() * 1000)

def extract_sl_endpoint(self):
payload = jwt.decode(self.token, algorithms=["RS512"], options={"verify_signature": False})

Check failure

Code scanning / SonarCloud

JWT should be signed and verified

<!--SONAR_ISSUE_KEY:AZAXTWuWoQrHf9zGkb5i-->Don't use a JWT token without verifying its signature. <p>See more on <a href="https://sonarcloud.io/project/issues?id=red-hat-data-services_ods-ci&issues=AZAXTWuWoQrHf9zGkb5i&open=AZAXTWuWoQrHf9zGkb5i&pullRequest=1533">SonarCloud</a></p>
Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
This was the error:

Importing listener '/home/jenkins/workspace/odh/odh-smoke/ods-ci/ods_ci/utils/scripts/sealights/SLListener.py' failed: KeyError: 'PYTHONPATH'
14:01:58  Traceback (most recent call last):
14:01:58    File "/home/jenkins/workspace/odh/odh-smoke/ods-ci/ods_ci/utils/scripts/sealights/SLListener.py", line 8, in <module>
14:01:58      import opentelemetry.instrumentation.auto_instrumentation.sitecustomize
14:01:58    File "/home/build/.local/ods-ci/.venv/lib/python3.11/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 44, in <module>
14:01:58      initialize()
14:01:58    File "/home/build/.local/ods-ci/.venv/lib/python3.11/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 32, in initialize
14:01:58      environ["PYTHONPATH"], dirname(abspath(__file__)), pathsep
14:01:58      ~~~~~~~^^^^^^^^^^^^^^
14:01:58    File "<frozen os>", line 679, in __getitem__
14:01:58  PYTHONPATH:
14:01:58    /home/jenkins/workspace/odh/odh-smoke/ods-ci/ods_ci/utils/scripts/sealights
14:01:58    /home/build/.local/ods-ci/.venv/bin
14:01:58    /usr/lib64/python311.zip
14:01:58    /usr/lib64/python3.11
14:01:58    /usr/lib64/python3.11/lib-dynload
14:01:58    /home/build/.local/ods-ci/.venv/lib64/python3.11/site-packages
14:01:58    /home/build/.local/ods-ci/.venv/lib/python3.11/site-packages
14:01:58    /home/jenkins/workspace/odh/odh-smoke/ods-ci

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
@jgarciao jgarciao force-pushed the add-sealights-integration-3 branch from a5b5474 to a24ae21 Compare June 14, 2024 15:25
Copy link
Contributor

github-actions bot commented Jun 14, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
482 0 0 482 100

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
@jgarciao jgarciao changed the title Add SeaLights integration files and deps Add SeaLights integration files and deps. Configure SonarCloud inclusions/exclusions Jun 14, 2024
@jgarciao jgarciao added the misc Miscelaneus (PR will be listed in release-notes) label Jun 14, 2024
Copy link

sonarcloud bot commented Jun 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@jgarciao jgarciao added the verified This PR has been tested with Jenkins label Jun 19, 2024
@bdattoma
Copy link
Contributor

bdattoma commented Jun 20, 2024

lgtm, have you noticed if the listener is affecting the duration of the runs? Other than dashboard as you noted in the description

@jgarciao jgarciao merged commit 032172d into red-hat-data-services:master Jun 20, 2024
7 checks passed
manosnoam pushed a commit to manosnoam/ods-ci that referenced this pull request Jul 1, 2024
…ions/exclusions (red-hat-data-services#1533)

* Add Sealights integration

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>

* Increase timeout in Wait For RHODS Dashboard To Load

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>

* Modify SSListener.py to try fixing error when runnig tests in Jenkins

This was the error:

Importing listener '/home/jenkins/workspace/odh/odh-smoke/ods-ci/ods_ci/utils/scripts/sealights/SLListener.py' failed: KeyError: 'PYTHONPATH'
14:01:58  Traceback (most recent call last):
14:01:58    File "/home/jenkins/workspace/odh/odh-smoke/ods-ci/ods_ci/utils/scripts/sealights/SLListener.py", line 8, in <module>
14:01:58      import opentelemetry.instrumentation.auto_instrumentation.sitecustomize
14:01:58    File "/home/build/.local/ods-ci/.venv/lib/python3.11/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 44, in <module>
14:01:58      initialize()
14:01:58    File "/home/build/.local/ods-ci/.venv/lib/python3.11/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 32, in initialize
14:01:58      environ["PYTHONPATH"], dirname(abspath(__file__)), pathsep
14:01:58      ~~~~~~~^^^^^^^^^^^^^^
14:01:58    File "<frozen os>", line 679, in __getitem__
14:01:58  PYTHONPATH:
14:01:58    /home/jenkins/workspace/odh/odh-smoke/ods-ci/ods_ci/utils/scripts/sealights
14:01:58    /home/build/.local/ods-ci/.venv/bin
14:01:58    /usr/lib64/python311.zip
14:01:58    /usr/lib64/python3.11
14:01:58    /usr/lib64/python3.11/lib-dynload
14:01:58    /home/build/.local/ods-ci/.venv/lib64/python3.11/site-packages
14:01:58    /home/build/.local/ods-ci/.venv/lib/python3.11/site-packages
14:01:58    /home/jenkins/workspace/odh/odh-smoke/ods-ci

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>

* Enable jwt signature verification (recommended by SonarCloud)
Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>

* Configure SonarCloud include and exclude folders
Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>

* Revert "Enable jwt signature verification (recommended by SonarCloud)"

This reverts commit a24ae21.

---------

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
Co-authored-by: Berto D'Attoma <88311595+bdattoma@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc Miscelaneus (PR will be listed in release-notes) verified This PR has been tested with Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants