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

chore(master): merge maint-0.9 (#92) #92

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

mdonadoni
Copy link
Member

Closes #90

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 3.78%. Comparing base (b0e3669) to head (4612f58).

❗ Current head 4612f58 differs from pull request most recent head 690dfc2. Consider uploading reports for the commit 690dfc2 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #92      +/-   ##
=========================================
- Coverage    3.82%   3.78%   -0.05%     
=========================================
  Files           6       6              
  Lines         183     185       +2     
=========================================
  Hits            7       7              
- Misses        176     178       +2     
Files Coverage Δ
reana_workflow_engine_snakemake/executor.py 0.00% <0.00%> (ø)

mdonadoni added a commit to mdonadoni/reana-workflow-engine-snakemake that referenced this pull request Mar 22, 2024
@mdonadoni mdonadoni changed the title fix(executor): override default resources to remove mem/disk (#91) chore(master): merge maint-0.9 (#92) Mar 22, 2024
@@ -16,15 +16,21 @@ check_commitlint () {
npx commitlint --from="$from" --to="$to"
found=0
while IFS= read -r line; do
if echo "$line" | grep -qP "\(\#$pr\)$"; then
commit_hash=$(echo "$line" | cut -d ' ' -f 1)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested changes:

Let's first detect three things about the current commit:

        commit_hash=$(echo "$line" | cut -d ' ' -f 1)
        commit_title=$(echo "$line" | cut -d ' ' -f 2-)
        commit_number_of_parents=$(git rev-list --parents "$commit_hash" -n1 | awk '{print NF-1}')

And then let's have some checking rules:

  1. Is this ommit ending with the good PR number? -> OK
        if echo "$commit_title" | grep -qP "\(\#$pr\)$"; then
            true
  1. Is this commit a release commit without a number? -> OK
        elif echo "$commit_title" | grep -qP "^chore\(.*\): release "; then
            true
  1. Is this commit a merge commit?
  • 3a) if it is of the type "chore(...): merge " then OK (and stop checking further commits);
  • 3b) otherwise reply that merge commits are not allowed in feature branches (and continue checking further commits).

Something like the following (untested):

        if [ "$commit_number_of_parents" -gt 1 ]; then
            if echo "$commit_title" | grep -qP "^chore\(.*\): merge "; then
                break
            else
                echo "✖   Merge commits are not allowed in feature branches: $message"
                found=1
            fi
        fi

Copy link
Member Author

Choose a reason for hiding this comment

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

I have implemented your suggestions, except that 3a/3b are now the first ones to be checked, as otherwise a merge commit whose title contains the correct PR number would not be considered an error even in a feature branch, given that it would pass check 1.

I have also changed a little bit the CI pipeline to consider commits from base..head instead of head~num_of_commits_in_pr..head, as the latter might include commits that are on the "wrong side" of the merge tree (that is, commits that are in base, which should not be considered as they are already merged)

Copy link
Member

Choose a reason for hiding this comment

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

Cosmetic comment: if the merge check case is now being done first, then perhaps you can also invert the two following cases, in order to have:

        elif echo "$commit_title" | grep -qP "^chore\(.*\): release"; then
            true
        elif echo "$commit_title" | grep -qP "\(\#$pr\)$"; then
            true

In this way all the merge-like special cases are listed first, followed by the regular PR case, and the final error in case the PR case is not passing.

mdonadoni added a commit to mdonadoni/reana-workflow-engine-snakemake that referenced this pull request Apr 18, 2024
Copy link
Member

@tiborsimko tiborsimko left a comment

Choose a reason for hiding this comment

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

Works nicely for merge commits 👍

Left a cosmetic comment about the order of cases in ./run-tests.sh --check-commitlint .

@mdonadoni mdonadoni merged commit 690dfc2 into reanahub:master Apr 22, 2024
11 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.

logs: misleading memory and disk limit
2 participants