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

Issue 1288: Adding CodeQL and Ruff as additional workflow items #1307

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

tamimfatahi
Copy link
Collaborator

@tamimfatahi tamimfatahi commented Sep 27, 2024

CodeQL will help identify vulnerability issues, and Ruff as a linter to detect errors and formatting suggestions.

  • I decided to replace Pylint with Ruff as many major projects are utilizing it due to speed.
  • If you want the configuration file for CodeQL added rather than having it queried, let me know and I can add it in.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is missing the codeql directory, which is the configuration, from here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll make sure to add them in.

name: Analyze
runs-on: ubuntu-latest
permissions:
actions: write
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it need write access? That seems like we're handing the VM a lot of power.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does not as it's merely analyzing the code. I'm assuming I should take away its permission to write during security-events as well?

with:
python-version: '3.10'
- name: Upgrade tooling
run: |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a way to use the build command to make this happen? Maybe through a virtual environment so there's not so much installation stuff (that seems a little friable for future upgrades)? Please let me know if I'm wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make what happen exactly? Upgrading tools? I'm a little confused what installing tools through a virtual environment would do in this situation and how it would mitigate the need to install extra stuff.

Also, I don't think we need pip3 install --upgrade build importlib_metadata setuptools setuptools_scm wheel as we're running a lint check on the code.

# to add extra rules or a configuration file.
run: ruff check --output-file ruff_report.txt . || true
continue-on-error: true
- name: Upload Artifact
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks great. But what if we don't compress it? Then maybe it can be viewable in the browser instead of requiring a bunch of clicks and unpacking, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can run ruff check --output-format=github . and have it output in the browser if you'd like.

run: |
pip3 install -r requirements.txt
pip3 install -e .
- name: Prepare PYTHONPATH
Copy link
Collaborator

Choose a reason for hiding this comment

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

All that path stuff is required, I think. Well maybe it can be condensed into the above: 'Prepare Test Environment' or something...

@jpl-jengelke jpl-jengelke changed the base branch from main to develop October 6, 2024 12:13
Copy link
Collaborator

@jpl-jengelke jpl-jengelke Oct 6, 2024

Choose a reason for hiding this comment

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

Let's talk about this one please. ... it's sort of a prototype for shared configurations, so needs things to be a little generic in some ways. In other ways, there are some customizations requested for EXOTIC.

Much of the file tested here may be better suited as a contribution to JPL's standards.

@jpl-jengelke jpl-jengelke marked this pull request as draft October 12, 2024 06:57
@jpl-jengelke
Copy link
Collaborator

I will hold this for the next release. We have a lot of balls up in the air. Thanks!

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