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

ci with custom git version #330

Merged
merged 2 commits into from
Oct 18, 2022
Merged

ci with custom git version #330

merged 2 commits into from
Oct 18, 2022

Conversation

hollesse
Copy link
Member

I adjusted the CI pipeline, such that it can be tested with different git versions. I would propose to go with latest and with the minimum git version we want to support. I do not know if we somewhere tell the user a minimum git version. Which version should we add here as minimum version @simonharrer @gregorriegler ?

@gregorriegler
Copy link
Collaborator

That is such a good idea. I love it.
Trying to find usage statistics for git versions. Could not find any.
But wikipedia has a nice summary of versions.
https://en.wikipedia.org/wiki/Git
We should probably at least support git starting with 2.17
Everything below that is not maintained anymore by git.

@simonharrer
Copy link
Member

I would rather reduce the version number until the pipeline breaks to learn what our current min is. Then we can decide what to do. Relying on the maintenance level of git is understandable, but who cares about whether their installed git version is maintained?

@gregorriegler
Copy link
Collaborator

gregorriegler commented Oct 13, 2022

TLDR:
mob.sh with squash-wip on ubuntu-latest supports git down to 2.20.0
mob.sh without squash-wip on ubuntu-latest supports git down to 2.13.0
can't test macos-latest as it fails to install git 2.20.5 already

ubuntu-latest with git 2.20.5 works

ubuntu-latest with git 2.19.6 fails

see #331

ubuntu-latest with git 2.19.6 [without squash-wip] works

ubuntu-latest with git 2.18.5 [without squash-wip] works

ubuntu-latest with git 2.17.6 [without squash-wip] works

ubuntu-latest with git 2.16.6 [without squash-wip] works

ubuntu-latest with git 2.15.4 [without squash-wip] works

ubuntu-latest with git 2.14.6 [without squash-wip] works

ubuntu-latest with git 2.13.7 [without squash-wip] works

ubuntu-latest with git 2.13.0 [without squash-wip] works

ubuntu-latest with git 2.12.5 [without squash-wip] fails

=== RUN   TestStartDoneCoAuthors
    mob_test.go:1598: Creating testbed in temporary directory /tmp/TestStartDoneCoAuthors2659808855/001
    mob_test.go:159[8](https://github.com/remotemobprogramming/mob/actions/runs/3245084997/jobs/5322143262#step:7:9):   git --bare init
    mob_test.go:15[9](https://github.com/remotemobprogramming/mob/actions/runs/3245084997/jobs/5322143262#step:7:10)8:   git symbolic-ref HEAD refs/heads/master
    mob_test.go:1598:   git clone --origin origin file:///tmp/TestStartDoneCoAuthors2659808855/001/remote .
    mob_test.go:1598:   git config --local user.name local
    mob_test.go:1598:   git config --local user.email [email protected]
    mob_test.go:1598:   git checkout -b master
    mob_test.go:1598:   git add .
    mob_test.go:1598:   git commit -m "initial import"
    mob_test.go:1598:   git push --set-upstream --all origin
    mob_test.go:1598:   git clone --origin origin file:///tmp/TestStartDoneCoAuthors2659808855/001/remote .
    mob_test.go:1598:   git config --local user.name localother
    mob_test.go:1598:   git config --local user.email [email protected]
    mob_test.go:1598:   git clone --origin origin file:///tmp/TestStartDoneCoAuthors2659808855/001/remote .
    mob_test.go:1598:   git config --local user.name alice
    mob_test.go:1598:   git config --local user.email [email protected]
    mob_test.go:1598:   git clone --origin origin file:///tmp/TestStartDoneCoAuthors2659808855/001/remote .
    mob_test.go:1598:   git config --local user.name bob
    mob_test.go:1598:   git config --local user.email [email protected]
    mob_test.go:1598:   git clone --origin origin file:///tmp/TestStartDoneCoAuthors2659808855/001/remote .
    mob_test.go:1598:   git config --local user.name local-symlink
    mob_test.go:1598:   git config --local user.email [email protected]
    mob_test.go:1598: 
        ===== cd /tmp/TestStartDoneCoAuthors2659808855/001/local
    mob_test.go:1598: ERROR git branch --remotes --format=%(refname:short)
    mob_test.go:1598: ERROR error: unknown option `format=%(refname:short)'
    mob_test.go:1598: ERROR usage: git branch [<options>] [-r | -a] [--merged | --no-merged]
    mob_test.go:1598: ERROR or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]
    mob_test.go:1598: ERROR or: git branch [<options>] [-r] (-d | -D) <branch-name>...
    mob_test.go:1598: ERROR or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>
    mob_test.go:1598: ERROR or: git branch [<options>] [-r | -a] [--points-at]
    mob_test.go:1598: ERROR 
    mob_test.go:1598: ERROR Generic options
    mob_test.go:1598: ERROR -v, --verbose         show hash and subject, give twice for upstream branch
    mob_test.go:1598: ERROR -q, --quiet           suppress informational messages
    mob_test.go:1598: ERROR -t, --track           set up tracking mode (see git-pull(1))
    mob_test.go:1598: ERROR --set-upstream        change upstream info
    mob_test.go:1598: ERROR -u, --set-upstream-to <upstream>
    mob_test.go:1598: ERROR change the upstream info
    mob_test.go:1598: ERROR --unset-upstream      Unset the upstream info
    mob_test.go:1598: ERROR --color[=<when>]      use colored output
    mob_test.go:1598: ERROR -r, --remotes         act on remote-tracking branches
    mob_test.go:1598: ERROR --contains <commit>   print only branches that contain the commit
    mob_test.go:1598: ERROR --abbrev[=<n>]        use <n> digits to display SHA-1s
    mob_test.go:1598: ERROR 
    mob_test.go:1598: ERROR Specific git-branch actions:
    mob_test.go:1598: ERROR -a, --all             list both remote-tracking and local branches
    mob_test.go:1598: ERROR -d, --delete          delete fully merged branch
    mob_test.go:1598: ERROR -D                    delete branch (even if not merged)
    mob_test.go:1598: ERROR -m, --move            move/rename a branch and its reflog
    mob_test.go:1598: ERROR -M                    move/rename a branch, even if target exists
    mob_test.go:1598: ERROR --list                list branch names
    mob_test.go:1598: ERROR -l, --create-reflog   create the branch's reflog
    mob_test.go:1598: ERROR --edit-description    edit the description for the branch
    mob_test.go:1598: ERROR -f, --force           force creation, move/rename, deletion
    mob_test.go:1598: ERROR --merged <commit>     print only branches that are merged
    mob_test.go:1598: ERROR --no-merged <commit>  print only branches that are not merged
    mob_test.go:1598: ERROR --column[=<style>]    list branches in columns
    mob_test.go:1598: ERROR --sort <key>          field name to sort on
    mob_test.go:1598: ERROR --points-at <object>  print only branches of the object
    mob_test.go:1598: ERROR -i, --ignore-case     sorting and filtering are case insensitive
    mob_test.go:1598: ERROR exit status 129
exit status 1
FAIL	github.com/remotemobprogramming/mob/v4	0.[10](https://github.com/remotemobprogramming/mob/actions/runs/3245084997/jobs/5322143262#step:7:11)9s
Error: Process completed with exit code 1.

macos-latest with 2.20.5 fails:

It fails to install the git version and does't even get to the tests

git: undefined method `sha1' for #<SoftwareSpec:0x00007f831d47ea58>

@gregorriegler gregorriegler mentioned this pull request Oct 13, 2022
@gregorriegler
Copy link
Collaborator

Ok, so we are now testing what we can.
On ubuntu, the minimum version that works, 2.37, and the latest.
On mac, I had to omit the minimum version as I could not install it.
I think for now, this is fine. git compile & install takes a lot of time though.
@hollesse please have a final look.

- name: Use Go 1.16.x
uses: actions/setup-go@v2
with:
go-version: '~1.16.0'
- name: Test
run: go test
run: go test -test.v
Copy link
Member Author

Choose a reason for hiding this comment

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

@gregorriegler do we need that -test.v flag? Or was that just for testing which version works and which not?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I added it so I can see the logs, because I didn't have any Feedback. And I think we should now keep it. The tests are not very useful if they don't tell you why they fail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But I agree, we should not need to use this flag in order to get the Feedback we need. I will create an Issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

fine for me.

@hollesse
Copy link
Member Author

@gregorriegler I added one comment. Everything else looks fine to me.

@hollesse hollesse marked this pull request as ready for review October 17, 2022 12:58
@@ -3,16 +3,39 @@ name: Test
jobs:
test:
strategy:
fail-fast: false
Copy link
Member Author

Choose a reason for hiding this comment

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

@gregorriegler I would remove that. We should fail fast in my opinion

Copy link
Collaborator

@gregorriegler gregorriegler Oct 17, 2022

Choose a reason for hiding this comment

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

Why would you want it? Are we not failing fast?

Let me tell you why I turned it off. So it was turned on, and what happened was that when one build failed, I didn't get to see the other builds finish. It all suddenly aborted. So I didn't get the feedback where the other builds would have failed and why.
It looks like a good way to save hardware resources. On the other hand I don't understand in what way we're not failing fast, if we keep running the other builds after one of them failed. We did see it fail, so we fail as soon as possible, even with the flag set to false, no?.
On python approvals for example, we also use this flag: https://github.com/approvals/ApprovalTests.Python/blob/ee6312d8848e7ee13e8bb5bafbe96bcd7053aa7a/.github/workflows/test.yml#L10

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 did some research again and github actions seem to be free for all public projects without any limit so this is fine for me.

@hollesse hollesse merged commit 2581904 into main Oct 18, 2022
@simonharrer simonharrer deleted the ci-git-version branch November 30, 2022 07:47
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