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

migrate skaraMirror.sh to be a python script #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gdams
Copy link
Member

@gdams gdams commented Apr 9, 2024

This gives us a lot more control over the mirror scripts and allows us to better test the code.

This script was used to generate https://github.com/gdams/jdk22u as a test.

@gdams gdams added pmc-agenda Issues to be discussed by the PMC enhancement New feature or request labels Apr 9, 2024
@gdams gdams force-pushed the migration branch 3 times, most recently from 7e60998 to 06975b8 Compare April 9, 2024 14:53
@gdams gdams force-pushed the migration branch 7 times, most recently from 7ca792f to 423b80e Compare April 10, 2024 12:53
Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

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

Trying to put down what I said in the PMC call earlier. I'm broadly neutral on this hence this just being a "review comment", but here is some food for thought for anyone else looking at this:

  • Since this is a rewrite (and is 538 lines instead of the 319 we have at present for the shell script) there is always a risk of introducing new and exciting bugs
  • This would diverge from almost everything else in this space that we have which is written in shell
  • Testing is nice, but we could implement suitable tests fairly simply on top of shell scripts, so I'm not sure I see python's unittest as a compelling reason in itself.

@tellison tellison removed the pmc-agenda Issues to be discussed by the PMC label Apr 17, 2024
Copy link
Contributor

@karianna karianna left a comment

Choose a reason for hiding this comment

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

Some nitpicks but overall this has test coverage in a higher order language and I think that's a good thing.

@@ -0,0 +1,4 @@
[flake8]
ignore =
# E501 line too long
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# E501 line too long
# E501 line too long


jobs:
linter:
# Name the Job
Copy link
Contributor

Choose a reason for hiding this comment

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

comment in the wrong place and probably not needed

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Markdown lint complains about the issue templates
FILTER_REGEX_EXCLUDE: .github/ISSUE_TEMPLATE/*
# Lots of shellcheck errors - need fixing
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a TODO or a new issue for this.

# Apply patches if required
apply_patches_if_needed(workspace, github_repo)

# Find the latest and previous release tags that is not in releaseTagExcludeList
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Find the latest and previous release tags that is not in releaseTagExcludeList
# Find the latest and previous release tags that are not in releaseTagExcludeList

)
newAdoptTags.append(adoptTag)

if repo.git.rev_parse(
Copy link
Contributor

Choose a reason for hiding this comment

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

Scoping of this if or the print below seems off?

):
print(repo.git.log("--oneline", "origin/release..release"))

# Find the latest and previous release tags that is not in releaseTagExcludeList
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Find the latest and previous release tags that is not in releaseTagExcludeList
# Find the latest and previous release tags that are not in releaseTagExcludeList

remote.fetch(**{"tags": True})


def perform_merge_into_release_from_master(workspace, github_repo, branch):
Copy link
Contributor

Choose a reason for hiding this comment

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

Long Python function is Long :-). I think there's some natural places where smaller, well named functions can be extracted

if os.path.exists(main_workflow_file) and not is_patch_applied(
main_workflow_file, "- dev"
):
patch_file = os.path.join(
Copy link
Contributor

Choose a reason for hiding this comment

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

scoping seems off here?

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

A block has been put on this Pull Request as this repository is temporarily under a code freeze due to an ongoing release cycle.

If this pull request needs to be merged during the release cycle then please comment /merge and a PMC member will be able to remove the block.

If the code freeze is over you can remove this block by commenting /thaw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants