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

Remove maven and synchronise release workflow #41

Merged
merged 55 commits into from
Apr 18, 2024

Conversation

ignacio-penas
Copy link
Contributor

closes sixsq/tasklist#3005

@ignacio-penas ignacio-penas self-assigned this Feb 29, 2024
Copy link
Contributor

github-actions bot commented Feb 29, 2024

| Unit Tests Results: Common Library |

16 tests   16 ✔️  0s ⏱️
  1 suites    0 💤
  1 files      0

Results for commit 5a9bbec.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Feb 29, 2024

Unit Test Results

0 tests   - 16   0 ✔️  - 16   0s ⏱️ ±0s
0 suites  -   1   0 💤 ±  0 
0 files    -   1   0 ±  0 

Results for commit 7aa22c0. ± Comparison against base commit 105de9b.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@konstan konstan 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 comments.

pyproject.toml Outdated
packages = [{include = "nuvla"}]

[tool.poetry.dependencies]
python = "^3.8"
Copy link
Contributor

Choose a reason for hiding this comment

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

@ignacio-penas Should it not be 3.11?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ^ operator indicates that we support any python 3 version whose minor is >=8

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to: ">=3.9, <3.12"

.github/workflows/unittest.yml Show resolved Hide resolved

# Temporary disabled until we solve the issue with the sonarcloud token
- name: SonarCloud Scan
if: matrix.python_version == '3.11'
Copy link
Contributor

Choose a reason for hiding this comment

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

@ignacio-penas If possible I would define the following global env vars

PYTHON_VER_MATRIX=["3.9", "3.10", "3.11"]
PYTHON_VER_LAST=$(last ${PYTHON_VER_MATRIX}) # I'm obviously hand-waving here

and then using it in the matrix definition list

python_version: ${PYTHON_VER_MATRIX}

and then use ${PYTHON_VER_LAST} here and a bit below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@konstan github workflows does not allow global env vars (Only if defined from the repository it self) and when defining envs within a job, the allowed types are string, float and int. So I think this would overcomplicate things.

So I'd say we either do it with repository (or organization) level variables. Or leave it as is.

For the first approach, this is the implementation done to build the matrix on the validation workflows:
https://github.com/nuvlaedge/nuvlaedge/blob/c24f77632cfc1f7480719ca908e92ed61fcf9f2c/.github/workflows/validation.yml#L43-L63

Copy link
Contributor

Choose a reason for hiding this comment

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

This was my suspicion when I was commenting. What I don't like is "3.11" is all over the "place". So, I tried to suggest a refactor. But if, as you say, the vector definitions are not possible, I would still opt for defining the last (highest supported) version number as I see it's used in a number of places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Solved using the repository level variable: SUPPORTED_PYTHON_VERSIONS. Then, using jq to extract the last value of the array.
So now updating supported python version versions would require updating the above mentioned variable and pyproject.toml file.

on:
push:
branches:
- main
Copy link
Contributor

Choose a reason for hiding this comment

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

@ignacio-penas Is this for future possible change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@konstan I don't think I understand your question.

The trigger for the release action should be done only when merging into main so that the release PR is created against main too.

Copy link
Contributor

Choose a reason for hiding this comment

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

ATM the git project uses master as the trunk branch. My question was regarding main branch name in the list of the branches (where indeed master is present).

- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.11'
Copy link
Contributor

Choose a reason for hiding this comment

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

@ignacio-penas Is there a way of getting rid of the version number here? Here is the doc https://github.com/marketplace/actions/setup-python

Maybe using .python-version file and reusing it in other places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@konstan I think this would be optimal since we already work with pyproject.toml files

Screenshot 2024-03-15 at 10 31 03

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Version extraction working with pyproject.toml. It takes the latest from ">=3.9, <3.12". ATM is 3.11.8.

Copy link

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

1 similar comment
Copy link

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

Copy link

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

Copy link
Contributor

@konstan konstan left a comment

Choose a reason for hiding this comment

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

LGTM. There a comment about main/master branches.

on:
push:
branches:
- main
Copy link
Contributor

Choose a reason for hiding this comment

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

ATM the git project uses master as the trunk branch. My question was regarding main branch name in the list of the branches (where indeed master is present).

branches:
- "main"
- "master"

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here: ATM the git project uses master as the trunk branch. Did you add main just anticipating the future change of the trunk branch name from master to main?

@0xbase12
Copy link
Contributor

@ignacio-penas looks good to me. The only thing that I found is that the badge in the readme will stop working after merge

@ignacio-penas
Copy link
Contributor Author

@0xbase12 Fixed to align with release.yml

@ignacio-penas ignacio-penas merged commit 7e50d70 into master Apr 18, 2024
7 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.

3 participants