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

fix(ci): make Python version dynamic #68

Merged
merged 3 commits into from
Feb 7, 2025
Merged

fix(ci): make Python version dynamic #68

merged 3 commits into from
Feb 7, 2025

Conversation

Nidhi091999
Copy link
Contributor

@Nidhi091999 Nidhi091999 commented Jan 20, 2025

Resolves: #67

Summary by Sourcery

CI:

  • Use the Python version defined by cookiecutter.python_version in the vulnerability check workflow.

Copy link

sourcery-ai bot commented Jan 20, 2025

Reviewer's Guide by Sourcery

This pull request makes the python version in the vulnerability workflow dynamic by using the cookiecutter variable.

Flow diagram for dynamic Python version in vulnerability workflow

graph TD
    A[Cookiecutter Template] -->|python_version variable| B[vulnerability.yaml]
    B -->|Used in| C[Poetry Setup Action]
    C -->|Configures| D[Python Version for Vulnerability Checks]
    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C fill:#dfd,stroke:#333,stroke-width:2px
    style D fill:#fdd,stroke:#333,stroke-width:2px
Loading

File-Level Changes

Change Details Files
Make python version dynamic in vulnerability workflow.
  • Replaced hardcoded python version with cookiecutter variable in the vulnerability workflow.
{{ cookiecutter.project_name_dashed }}/.github/workflows/vulnerability.yaml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Nidhi091999 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@uniqueg uniqueg changed the title Make Python version dynamic in vulnerability.yaml fix(ci): make Python version dynamic Jan 21, 2025
Copy link
Member

@uniqueg uniqueg left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @Nidhi091999! LGTM, but I would like @JaeAeich to have a look as well before merging.

@uniqueg uniqueg requested a review from JaeAeich January 21, 2025 06:16
@JaeAeich
Copy link
Collaborator

Please do the same in actions.yaml as well for inputs.python_version.

Note the raw tag, you will have to bring that below otherwise jinja templating wont work.

Copy link
Collaborator

@JaeAeich JaeAeich left a comment

Choose a reason for hiding this comment

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

Please see the comment.

@Nidhi091999
Copy link
Contributor Author

Please do the same in actions.yaml as well for inputs.python_version.

Note the raw tag, you will have to bring that below otherwise jinja templating wont work.

Done

@JaeAeich
Copy link
Collaborator

One way to test if your changes are good and not breaking anything is to:

  • Commit you changes (it wont work without committing).
  • Run cruft create . and keep pressing enter till it create a project names python-cookiecutter.
  • cd python-cookiecutter
  • git init; git add .; git commit -m "init"
  • make fl, note this should not change anything, check in git diff or vscode git tab, if it does change anything you need to make changes.
  • make pc, same as above, shouldn't change anything.

Note: There is a possibility that you some of the hooks when you run make pc break, which might not be your fault, we have issues open for them and will be fixed later, the easiest way to do this is create another project ie cruft create . on main branch and compare.

@JaeAeich
Copy link
Collaborator

We will implement CI for all of this stuff maybe you can take the initiative if you want, happy to help. Wasn't a priority for us, but I can see the need now.

@Nidhi091999 maybe open an issue for this with title like ci: implement CI/CD or something.

@Nidhi091999
Copy link
Contributor Author

One way to test if your changes are good and not breaking anything is to:

  • Commit you changes (it wont work without committing).
  • Run cruft create . and keep pressing enter till it create a project names python-cookiecutter.
  • cd python-cookiecutter
  • git init; git add .; git commit -m "init"
  • make fl, note this should not change anything, check in git diff or vscode git tab, if it does change anything you need to make changes.
  • make pc, same as above, shouldn't change anything.

Note: There is a possibility that you some of the hooks when you run make pc break, which might not be your fault, we have issues open for them and will be fixed later, the easiest way to do this is create another project ie cruft create . on main branch and compare.

Thank you for the commands. I have tested my changes, and there are no liniting issues. However, there are some linting warnings in other parts of the code, which I will address in a separate PR shortly.

@JaeAeich JaeAeich self-requested a review January 25, 2025 03:51
Copy link
Collaborator

@JaeAeich JaeAeich left a comment

Choose a reason for hiding this comment

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

LGTM!! Nice :)

@JaeAeich
Copy link
Collaborator

@Nidhi091999 seems like your commits aren't verified, maybe go ahead and create a gpg key, add it to github and so that all your other commits are verified.

look into these instruction.

@Nidhi091999
Copy link
Contributor Author

@Nidhi091999 seems like your commits aren't verified, maybe go ahead and create a gpg key, add it to github and so that all your other commits are verified.

Thanks for the instructions! I've generated a new GPG key and added it to GitHub.

@JaeAeich
Copy link
Collaborator

JaeAeich commented Jan 30, 2025

@uniqueg these changes are good, maybe lets bypass the verified signature rule for now, given @Nidhi091999's further changes will be verfied 🚀

@JaeAeich JaeAeich merged commit e6ebab6 into main Feb 7, 2025
@JaeAeich JaeAeich deleted the nidhi/issue-67 branch February 7, 2025 01:49
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.

fix(ci): python verison is hardcoded.
3 participants