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

feat: clean up & refactor majorly #171

Merged
merged 37 commits into from
May 19, 2024
Merged

feat: clean up & refactor majorly #171

merged 37 commits into from
May 19, 2024

Conversation

JaeAeich
Copy link

@JaeAeich JaeAeich commented May 11, 2024

Description

  • Refactor code base and cleanup.
  • Add poetry as package management to leverage locking deps.
  • Add some CI check (commit-lint and merge conflicts)
  • CI lint and format using (ruff)
  • Add mypy
  • Add safety for deps vulnerability checks.
  • Add bandit for code vulnerability check.
  • Update Dockerfile (Image size increased by 24mb, 150 -> 174)

fixes - #152 #153 #154 #155

@JaeAeich JaeAeich changed the base branch from master to main May 11, 2024 08:22
@JaeAeich

This comment was marked as resolved.

@JaeAeich
Copy link
Author

everything seems to work post python version 3.11, I'll shift make name change, ie src->tesk at least, rest need to be discussed.

MANIFEST.in Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
deployment/charts/tesk/.gitignore Outdated Show resolved Hide resolved
deployment/examples/inputFile.json Outdated Show resolved Hide resolved
tesk/tesk_core/README.md Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
tests/unit_test/service/FilerClassTest.py Outdated Show resolved Hide resolved
and addd help command for the repo to explain
the scripts available
@JaeAeich JaeAeich requested a review from uniqueg May 11, 2024 17:30
@uniqueg
Copy link
Member

uniqueg commented May 11, 2024

Also, why are Python 3.8, 3.9 and 3.10 failing, @JaeAeich?

On the other hand, it's not clear to me why we are even testing multiple Python versions, TESK is not a library. We pick one version and use that version, no need to support multiple Python versions...

@JaeAeich
Copy link
Author

JaeAeich commented May 11, 2024

Also, why are Python 3.8, 3.9 and 3.10 failing, @JaeAeich?

On the other hand, it's not clear to me why we are even testing multiple Python versions, TESK is not a library. We pick one version and use that version, no need to support multiple Python versions...

I have no idea, lack of backwards compatibility ig, I haven't touched any code of tesk_core yet. Should I freeze python version to 3.11 and above (for pyproject.toml)? Will remove the other versions from API.

Also core seems to use kubernetes client v9 and rn its on v29 😶‍🌫️ , I'll definetely have to refactor core code as well in order to start to use same k8s client version on api.

@uniqueg
Copy link
Member

uniqueg commented May 18, 2024

Hey there are some TODOs that I'll take care in this PR itself, please ignore those and review the rest :)

They're here: https://github.com/elixir-cloud-aai/TESK/settings/branches

You need to edit the rule for branch main, then under "Require status checks to pass before merging" you need to use the search box to add the checks by name, e.g., "code-vulnerabilities" or "Semantic PR title".

Anyway, I have done that now in case you don't have access to that setting.

@JaeAeich
Copy link
Author

Yeah I don't have the rights, but thanks for updating it :)

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.

Amazing job @JaeAeich. Of course the PR is waaay too big to review in depth (and also it's not always clear what was new code and what was just renamed but not picked up by the system, e.g., TESK-core code and corresponding tests). But I understand that this was +/- necessary to keep tests passing (which is commendable). Still, in the future, I hope we will get small, iterative PRs ;-)

Anwyay, I suggest that after addressing (or acknowledging and potentially creating issues for the future) the comments and a final review, we should be good to go for merging. There are likely still several issues (mostly legacy ones), but we can address them iteratively.

.dockerignore Outdated Show resolved Hide resolved
.dockerignore Outdated Show resolved Hide resolved
.dockerignore Outdated Show resolved Hide resolved
.dockerignore Show resolved Hide resolved
.github/workflows/pr_evaulations.yaml Outdated Show resolved Hide resolved
tests/test_unit/service/resources/copyDirTest/dst2/a/1.txt Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@JaeAeich
Copy link
Author

JaeAeich commented May 18, 2024

We need codecov token, and helm CI is not running, we need to test that as well, I have broken that into multiple jobs to comply with a "consistency".

Apart from that since this PR has grown big enough why not discuss some extra things I found while going through other repos and etc etc.

  • Consider adding DCO check in CI.
  • Consider adding OSS licence compliance (license scan seems to be free 🤞 ) that shows, well what is says :), we can add its card to the readme as well with codecov, coverage.

@JaeAeich JaeAeich requested a review from uniqueg May 18, 2024 13:40
@uniqueg
Copy link
Member

uniqueg commented May 18, 2024

We need codecov token, and helm CI is not running, we need to test that as well, I have broken that into multiple jobs to comply with a "consistency".

Apart from that since this PR has grown big enough why not discuss some extra things I found while going through other repos and etc etc.

  • Consider adding DCO check in CI.
  • Consider adding OSS licence compliance (license scan seems to be free 🤞 ) that shows, well what is says :), we can add its card to the readme as well with codecov, coverage.

Sure, feel free to add (low priority) issues for these :)

@uniqueg
Copy link
Member

uniqueg commented May 18, 2024

We need codecov token, and helm CI is not running, we need to test that as well, I have broken that into multiple jobs to comply with a "consistency".

Apart from that since this PR has grown big enough why not discuss some extra things I found while going through other repos and etc etc.

  • Consider adding DCO check in CI.
  • Consider adding OSS licence compliance (license scan seems to be free 🤞 ) that shows, well what is says :), we can add its card to the readme as well with codecov, coverage.

CODECOV_TOKEN is now set for this repo. Not sure what you need for the Helm CI, but I think we should merge this ASAP before it gets even more unwieldy. I propose that you remove the part that installs the chart for now (we can get it back from master later on), which is likely the one that fails at the moment? Or even remove the entire workflow.

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.

We're getting there, just a few small issues before we can merge.

However, sth is weird about your Git workflow. Several (but not all) files are shown here as completely new, even though there were just moved or a few lines were changed (e.g., pyproject.toml, some but not all test files moved from service to test_service). Try to figure out why that is and avoid it in the future, because it makes things hell to review and also you git blame will show you as the author of all of that code, even if you are not.

test_unit Outdated Show resolved Hide resolved
test_unit.xml Outdated Show resolved Hide resolved
Copy link

codecov bot commented May 19, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@JaeAeich
Copy link
Author

We're getting there, just a few small issues before we can merge.

However, sth is weird about your Git workflow. Several (but not all) files are shown here as completely new, even though there were just moved or a few lines were changed (e.g., pyproject.toml, some but not all test files moved from service to test_service). Try to figure out why that is and avoid it in the future, because it makes things hell to review and also you git blame will show you as the author of all of that code, even if you are not.

I don't think there is anything wrong with my workflow, the issue was that the code files were not formatted at all and had inconsistent spacing even between two words 😅 , plus fixing some minor issues to comply with Google's python coding guide like changing string concatenation to f string, these kind of small fixes were cluttered all around the code base. I believe that is the cause of this weird blame thing. But if it happens again I'll be sure to check into it :)

@JaeAeich JaeAeich requested a review from uniqueg May 19, 2024 05:35
@JaeAeich
Copy link
Author

JaeAeich commented May 19, 2024

@uniqueg please check if the badge I added is correct.

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.

LGTM, I'm gonna merge. From now on please keep the PRs small and semantic 😆

@uniqueg uniqueg changed the title feat: refactor codebase and cleanup feat: major refactor & clean-up May 19, 2024
@uniqueg uniqueg changed the title feat: major refactor & clean-up feat: clean up & refactor majorly May 19, 2024
@uniqueg uniqueg enabled auto-merge (squash) May 19, 2024 11:28
@uniqueg uniqueg disabled auto-merge May 19, 2024 11:30
@uniqueg uniqueg enabled auto-merge (squash) May 19, 2024 11:30
@uniqueg uniqueg merged commit 0b81865 into main May 19, 2024
15 checks passed
@uniqueg uniqueg deleted the makefile branch May 19, 2024 11:34
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