-
Notifications
You must be signed in to change notification settings - Fork 320
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
Unify build workflows and argument specification #2224
Conversation
bd34b91
to
efe88df
Compare
Additionally this PR suggests a way to make the additional external-pr workflow obsolete. You can see the result here: HannesWell#2 This is somehow an enhanced version of what was suggested in #2211 (comment). |
OK, I now noticed that the build-maven-artifacts job has a different root/working directory. Restored (and simplified) that part. |
@HannesWell Thank you for restoring the Maven build. I was about to tell you about that: it's better to keep it because, in the past, we had troubles with the maven plugins depending on the full target platform in the full build. Cool that you found a way to deal with external PRs better! Are you sure it works as expected? I mean, you tested it internally by creating a PR against your repo, right? But what happens if the PR is really external? Concerning "Glad" the macOS build fails for you as well: I started to see that problem in my fork as well, and I guess that's due to Maven 3.9.1 used in the macOS environment and maybe to some dependency problems of mwe2 (but I'll open another issue for that). |
Understand 👍🏽
I'll test that case with a second fork and let you know, but I'm optimistic.
Understand, I restored that.
That could be possible. As far as I know Tycho 2.7.5 is not for sure compatible with Maven 3.9.1 and the GH-runners seems to have different maven versions. Some have 3.8.6 and some 3.9.1 |
Furthermore I inlined the value of the JENKINS_URL variable, because I assume it is very unlikely that one uses another URL for that value. Or is that a common use-case? Furthermore I would like to suggest to inline the scripts used in the Jenkins piplines. That would make the pipelines simpler to understand since there is less indirection. In general there are many scripts in the repo root and multiple seem to serve the same purpose and I wonder if they are still used. If they are only used in the Jenkinsfile I suggest to inline them and reconsider if they are used locally. For example I would assume that signing is only performed in Jenkins and therefore is no need to specify a separate script for that. |
the jenkins url stems from times where our main builds were still done on typefox infrastructure |
Furthermore, IIRC, Maven 4 will prohibit properties in repositories. For me, it's OK to remove the JENKINS_URL. Concerning inlining the scripts, I think I was told to leave them there. I don't have strong opinions on that. We don't even use them in GitHub Actions anyway. I leave the decision to @cdietrich . |
@HannesWell I'm fine with PR, apart from the decision on script files as I said above. Moreover, could you please confirm that PRs work as intended? I mean, you verified that it does not start in the same repository, but what about if it's really external? I'm not sure the pre-merge of PRs in GitHub Actions takes into consideration your own changes to the YAML files. Or does it? |
9267ce8
to
45abf18
Compare
I don't fully understand what you mean by that? Are you referring to the plan that with maven-4 the consumer pom will only contain the resolved values of properties used inside the pom?
Understand, then @cdietrich can you please decide?
OK, great. I just removed of few more occurances of the JENKINS_URL.
I would like to do that, but unfortunately I cannot create a second fork. I tried to pretend an external PR by temporarily changing the base URL in HannesWell#3, but this of course still receives the push events and therefore runs all jobs twice. But it at least shows that the pull_request event based builds are then executed. Therefore I'm confident that this will work as expected. But if you want to be really sure, just please open a PR against my fork. I pushed the head of this PR to the main branch of my fork. So you could just push any change.
From my observations and as far as I know in PRs only the changes from people with write access to the repository are taken into account immediately. The same applies for the Jenkins pipeline. Otherwise external people could simply extract credentials by modifying a workflow/Jenkinsfile and open a PR. But since I'm not a committer in xText my changes are not taken into account immediately. |
I mean that, IIRC, in Maven 4.0.0, you cannot use a property when specifying a URL of a
I have two GitHub actions users for that, that's how I experimented for my original solution in a small example ;) |
Yes I thought about that as well, but for this I was a bit lazy and just asked you. :)
The inlining of the scripts is the only open point in this PR. @cdietrich would that be ok as described above? |
what inlining are you referring to? |
My suggestion from above
|
@HannesWell i did not get what exactly you want to change. |
OK, sorry I didn't understand that. I'm suggesting instead of calling for example
Delete the script and for local builds to use a M2E Maven launch config. |
so you want to basically change the Jenkins file to call mvn -something @LorenzoBettini do we have jenkinsfiles for the nightly and the milestones already? |
@cdietrich @HannesWell currently we have 3 Jenkinsfile that are active
I don't know if inlining the scripts is a good idea now... at least, I wouldn't touch In the meantime, I'd merge this PR, which seems to work like a charm :) |
- Merge the external-pr workflow into the maven workflow - Create .mvn/maven.config and common build arguments to it - Remove unused environment variable 'WORKSPACE' and inline 'JENKINS_URL' env-variable.
Thanks for that list, I think the two deploy pipelines can also be merged into one, but I'll be happy to discuss that in a dedicated follow-up PR, where I would also do the inlining of the full-buld scripts.
Yes please do so. For me this is ready. :) I just rebased on top of the current master and found two more occurrences of the JENKINS_URL variable and removed them. |
@HannesWell Thanks!
To be honest, I'd like to keep those two files separate since they do some slightly but important different things. I wouldn't want to maintain a complex Jenkinsfile with lots of conditions and the likes ;) |
I'm on the same page as Lorenzo. Rather than inlining everything into the Jenkinsfile, I'd rather have an easy way to run the exact same build locally as Jenkins / Gitlab Actions would. So if we have a long chain of mvn profiles/flags/goals that are used in the Jenkinsfile, the shell-script that I could also use locally has some charm. What do others think? |
Can we please first finish/submit this PR? |
@HannesWell merged! Thanks! |
This PR unifies the build in the following points
Please consider this as suggestion and let me know if I oversaw a usage of the removed elements.