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

Setup travis #30

Merged
merged 4 commits into from
Apr 2, 2020
Merged

Setup travis #30

merged 4 commits into from
Apr 2, 2020

Conversation

octonato
Copy link
Member

@octonato octonato commented Apr 2, 2020

Refs #3

@octonato
Copy link
Member Author

octonato commented Apr 2, 2020

This is basically a copy of the one we use in akka-persistence-jdbc without the cross-compilation.

And without whitesource and paradox

Copy link
Member

@ignasi35 ignasi35 left a comment

Choose a reason for hiding this comment

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

LGTM except for a doubt on the publish condition

.travis.yml Outdated

# runs on main repo master commits and version-tagged commits
- name: publish
if: repo = akka/akka-persistence-jdbc AND ( ( branch = master AND type = push ) OR tag =~ ^v )
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, publish on a push to master? (even if there's no tag)

Copy link
Member Author

Choose a reason for hiding this comment

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

also the akka-persistence-jdbc leftover

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'm comparing this to akka-grpc, it has branch = master AND type != pull_request.

I guess what is happening here is that when you create a tag in GitHub, it's a push to master. So, either type = push or type != pull_request

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, pushing a tag upstream is a push to master? What if the tag is on stable branch 1.5.x?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, you mean when you create a tag in GitHub in GitHub in particular... I see. 🤔 I have no idea.

Copy link
Member

Choose a reason for hiding this comment

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

I still find somethings weird on the conditon ( ( branch = master AND type = push ) OR tag =~ ^v ) but if you copied it from elsewhere and it works there we can go ahead and fix it later.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's what I mean. But I think you spotted something that we were not aware of.

This is an OR condition. So, either we are publishing because adding a tag triggers a push on master (which is what I think it's happening) or we publish because there is a tag (which explain how we can publish for other branches).

I took it from akka-persistence-jdbc. It was added by Ennu. Alpakka projects are doing the same and akka-grpc as well.

@ennru / @raboof, can you shed a light on it?

I think the right condition should be:
if: repo = akka/akka-projection AND tag =~ ^v

Copy link
Member

Choose a reason for hiding this comment

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

master is there to do the snapshot releases on every merge to master.

Copy link
Member

Choose a reason for hiding this comment

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

@ennru that needs a bit more setting up, right? I mean, we'll probably need sbt-dynver, maybe some extra setting in the publishing logic?

BTW, I'm 100% in favor of sbt-dynver and publishing all commits in master to a snapshots repo.

ignasi35
ignasi35 approved these changes Apr 2, 2020
@octonato octonato merged commit ca629a1 into akka:master Apr 2, 2020
@octonato octonato deleted the travis-build branch April 2, 2020 19:31
@octonato octonato mentioned this pull request Apr 2, 2020
2 tasks
.travis.yml Outdated
Comment on lines 7 to 8
# make comparing to origin/master work and fetch full history for correct current and previous version detection
- git remote set-branches --add origin master && git fetch --unshallow
Copy link
Member

Choose a reason for hiding this comment

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

This is required (as the comment states) as dynver and MiMa can get problems without it (Only shows when there is a lot of commits between versions).

Copy link
Member Author

Choose a reason for hiding this comment

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

This was failing. That's why I removed. I guess there are some pre-conditions in the repo before you can call fetch --unshallow.

I still need to investigate it. Maybe @dwijnand can shed some light on it.

Copy link
Member

Choose a reason for hiding this comment

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

$ git clone --depth=50 https://github.com/akka/akka-projection.git akka/akka-projection
...
$ git remote set-branches --add origin master && git fetch --unshallow
fatal: --unshallow on a complete repository does not make sense
The command "git remote set-branches --add origin master && git fetch --unshallow" failed and exited with 128 during .

You can make that

[ $(git rev-parse --is-shallow-repository) = true ] && git fetch --unshallow

Copy link
Contributor

Choose a reason for hiding this comment

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

Try to use Travis settings:

git:
  depth: false # Avoid sbt-dynver not seeing the tag

Copy link
Member Author

@octonato octonato Apr 8, 2020

Choose a reason for hiding this comment

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

@ihostage, are you saying what this Travis option makes the git fetch --unshallow redundant?

Copy link
Member Author

Choose a reason for hiding this comment

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

To be honest, I think I prefer:
[ $(git rev-parse --is-shallow-repository) = true ] && git fetch --unshallow

Simply because if depends on git and not some Travis impl.

Copy link
Contributor

Choose a reason for hiding this comment

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

It says Travis itself 😄
https://docs.travis-ci.com/user/customizing-the-build#git-clone-depth

Some operations on the repository, such as common automated code review scripts (e.g. Pronto for Ruby), may fail due to the limited git clone depth, not being able to access all the objects in the repository. Removing the depth flag, or running git fetch --unshallow might solve the issue.

version := "0.0.1-SNAPSHOT"
Copy link
Member

Choose a reason for hiding this comment

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

Why not Dynver?

Copy link
Member Author

Choose a reason for hiding this comment

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

See #26

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.

5 participants