Page MenuHomePhabricator

Setup Continuous Integration via GitLab
ClosedPublic

Authored by CLOVIS on Apr 24 2019, 8:26 AM.

Details

Reviewers
Info-Screen
WyldBot
Hackintosh5
Maniphest Tasks
T357: CI for the lib
Commits
rLIBWFJVA78e53107fd6e: Setup Continuous Integration via GitLab
rLIBWFJVA2342782a67ee: Use rm -f instead of a test
rLIBWFJVAca0f5204d59a: Remove copyright in Gradle file
rLIBWFJVA52d384c2b052: Do not apply copyright on Gradle and other generated files
rLIBWFJVAb09dfa42cb26: Clarify log error when api.sh doesn't find `lsof`
rLIBWFJVA3bdb3ba4894f: Upgrade the Gradle wrapper to 5.2.1
rLIBWFJVAef1b5d1b214a: Upload the JUnit results
rLIBWFJVAe492584e7c6c: Do not delete the file db.sqlite3 if it doesn't exists (to have a cleaner log…
rLIBWFJVA8af41a5f02e9: Fix broken api.sh for Python versions about 3.6
rLIBWFJVA3034004ca9d7: Test the Gradle cache before running the scripts
rLIBWFJVAdfcaf585a45f: Documentation in .gitlab-ci.yml
rLIBWFJVA888cbde3b040: Upload JUnit results as artifacts
rLIBWFJVA4124365fcd96: Update the API
rLIBWFJVA42b7ac828515: Fix query order (posts are not always in the same order)
rLIBWFJVAfc43a8407b9c: Gradle cache
rLIBWFJVA6e7f9c43c340: Run Dokka alongside the unit tests, to speed up builds
rLIBWFJVA47daf60995ab: Pip cache, reports as artifacts, Gradle without daemon
rLIBWFJVA789e274a5a60: Reordering dependencies for clarity
rLIBWFJVAd8130880130a: Better cache for CI
rLIBWFJVA15832588efd0: # Ceci est la combinaison de 2 commits. # Ceci est le premier message de…
rLIBWFJVA6a626246fdc6: Cleaning the Dockerfile
rLIBWFJVA064405b12051: Assume API is not running when lsof is missing
rLIBWFJVA0a2c6f80b862: Do not run tests with static analysis
rLIBWFJVAf65d2cd7e335: Add virtualenv, PostGresQL, Git, OpenJDK sources, GCC to the container
rLIBWFJVA618f3e84980d: Cache wheels
rLIBWFJVA2cdfe42f23cf: Remove pointless lsof
rLIBWFJVA5445ba44e87b: Cache Gradle dependencies
rLIBWFJVAd992085f926d: Removed after_script
rLIBWFJVAe956045e9f87: What is running on port 8000 in the container?
rLIBWFJVA34b0db819cb4: Dockerfile with Java & Python
rLIBWFJVA57057d4fe334: Fix parallel tests when there's only 1 available core
rLIBWFJVA4f30c126f49b: Clone the submodule with HTTPS instead of SSH (no keys on CI servers)
rLIBWFJVAf9e0a8491e06: Prototype of .gitlab-ci.yml
rLIBWFJVA887649ebdfe8: Merge branch 'master' of ssh://phabricator.wildfyre.net/source/libwf-java
Summary

Set everything needed to run CI via GitLab

Closes T357

Test Plan

See branch gitlab-ci

Diff Detail

Branch
gitlab-ci
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 678
Build 678: arc lint + arc unit

Event Timeline

CLOVIS created this revision.Apr 24 2019, 8:26 AM
CLOVIS edited the summary of this revision. (Show Details)
Hackintosh5 added inline comments.Apr 24 2019, 12:06 PM
.gitlab-ci.yml
24

Don't use --no-daemon.

31

Don't use --no-daemon.

42

Don't use --no-daemon.

52

Don't use --no-daemon.

api.sh
49

This is in --norun, it must not start the api

76–77

use rm -f instead of test followed by delete.

81–82

no need for an & as exec replaces the current process. if you want to run in the background remove exec

gradle/wrapper/gradle-wrapper.properties
2

You can't really copyright this...

settings.gradle
2 ↗(On Diff #877)

Can't copyright this either

Hackintosh5 requested changes to this revision.Apr 24 2019, 12:06 PM
This revision now requires changes to proceed.Apr 24 2019, 12:06 PM
CLOVIS marked 5 inline comments as done.Apr 24 2019, 12:59 PM
CLOVIS added inline comments.
.gitlab-ci.yml
24

"f you run CI builds in ephemeral environments (such as containers) that do not reuse any processes, use of the Daemon will slightly decrease performance (due to caching additional information) for no benefit, and may be disabled."

https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:why_the_daemon

31

See previous

42

See previous

52

See previous

api.sh
76–77

It's not about forcing, it's about not polluting the logs with "Could not remove db.sqlite3" when we don't care about it

Hackintosh5 added inline comments.Apr 24 2019, 1:02 PM
.gitlab-ci.yml
24

Ok.

api.sh
76–77

-f suppresses errors and accepts all queries. It's the right way to go as otherwise there's a risk (however tiny) that somehow db.sqlite3 is created in between. Also, -f is the 'right way'.

CLOVIS marked 5 inline comments as done.Apr 25 2019, 4:10 AM
Hackintosh5 commandeered this revision.Apr 25 2019, 7:51 AM
Hackintosh5 edited reviewers, added: CLOVIS; removed: Hackintosh5.
This revision now requires review to proceed.Apr 25 2019, 7:51 AM
Hackintosh5 updated this revision to Diff 886.Apr 25 2019, 9:50 AM

Fix stuff

  • Fix bad copyrights
  • Don't start API when --norun is specified
  • Use rm -f instead of test -f
Hackintosh5 updated this revision to Diff 887.Apr 25 2019, 9:52 AM

Fix background invocation

Remove exec for intended behaviour

You should've created a new diff, I won't merge something that destroys my commits

I haven't removed your commits....

git show [a commit ID]

If it's not signed with my PGP key, then it's not the real one

Dude. That commit was never signed. I just checked out arc revision 877 which is your original commit. I ran git show HEAD but there's no signature below the commit message.

Yeah, that's the point. Arc doesn't actually check out the commit, it just creates a copy of the diff. The commits you get from Arc are not the real ones.

So there was never a PGP signature anyway? It only ever existed on your local machine?

Well it did only exist on my machine; but that's because Arc doesn't send it.

(eg. The signature exists on the GitLab mirror)

Wel I have no idea how that works. You can commandeer this and fix it as I don't know what's wrong or how to fix it

Basically Arc sends the diff but not the actual commits, and recreates them when you arc patch. Since you don't have my private key, it's not able to sign the commits on your computer.

So, just put comments to what should be changed and I'll handle it ^^

WyldBot requested changes to this revision.May 12 2019, 2:25 PM
This revision now requires changes to proceed.May 12 2019, 2:25 PM
CLOVIS commandeered this revision.May 13 2019, 7:12 PM
CLOVIS edited reviewers, added: Hackintosh5; removed: CLOVIS.
CLOVIS updated this revision to Diff 914.May 13 2019, 8:51 PM
  • Fix broken script for python versions above 3.6
  • Upgrade the Gradle Wrapper (to enable Java 11 support)
  • Better error message in api.sh --no-run
  • Do not copyright Gradle & other generated files
CLOVIS updated this revision to Diff 915.May 13 2019, 8:55 PM
  • Fix Arcanist f*ck up
Harbormaster completed remote builds in B673: Diff 915.
CLOVIS updated this revision to Diff 916.May 13 2019, 8:59 PM
  • Use rm -f instead of a test
CLOVIS updated this revision to Diff 917.May 13 2019, 9:02 PM
  • Remove copyright in Gradle file
WyldBot requested changes to this revision.May 14 2019, 3:36 AM
WyldBot added inline comments.
.idea/copyright/profiles_settings.xml
8

No new line

.idea/scopes/Lib_Files.xml
4

No new line

This revision now requires changes to proceed.May 14 2019, 3:36 AM

You can actually probably gitignore all .idea folders/files

In D246#6277, @WyldBot wrote:

You can actually probably gitignore all .idea folders/files

I'd rather not, this way every dev has the same config right away, with the copyright setup, the Gradle tasks, etc

.idea/copyright/profiles_settings.xml
8

That's a generated file

.idea/scopes/Lib_Files.xml
4

Same here

CLOVIS requested review of this revision.May 15 2019, 7:20 PM
WyldBot accepted this revision.May 15 2019, 7:43 PM
This revision is now accepted and ready to land.May 15 2019, 7:43 PM
CLOVIS updated this revision to Diff 922.May 15 2019, 8:13 PM
  • Merge branch 'master' of ssh://phabricator.wildfyre.net/source/libwf-java
  • Prototype of .gitlab-ci.yml
  • Clone the submodule with HTTPS instead of SSH (no keys on CI servers)
  • Fix parallel tests when there's only 1 available core
  • Dockerfile with Java & Python
  • What is running on port 8000 in the container?
  • Removed after_script
  • Cache Gradle dependencies
  • Remove pointless lsof
  • Cache wheels
  • Add virtualenv, PostGresQL, Git, OpenJDK sources, GCC to the container
  • Assume API is not running when lsof is missing
  • Do not run tests with static analysis
  • Cleaning the Dockerfile
  • # Ceci est la combinaison de 2 commits.
  • Better cache for CI
  • Reordering dependencies for clarity
  • Pip cache, reports as artifacts, Gradle without daemon
  • Run Dokka alongside the unit tests, to speed up builds
  • Gradle cache
  • Fix query order (posts are not always in the same order)
  • Update the API
  • Upload JUnit results as artifacts
  • Test the Gradle cache before running the scripts
  • Documentation in .gitlab-ci.yml
  • Upload the JUnit results
  • Do not delete the file db.sqlite3 if it doesn't exists (to have a cleaner log output)
  • Fix broken api.sh for Python versions about 3.6
  • Upgrade the Gradle wrapper to 5.2.1
  • Clarify log error when api.sh doesn't find lsof
  • Do not apply copyright on Gradle and other generated files
  • Use rm -f instead of a test
  • Remove copyright in Gradle file
This revision now requires review to proceed.May 15 2019, 8:13 PM
WyldBot accepted this revision.May 15 2019, 8:16 PM
This revision is now accepted and ready to land.May 15 2019, 8:16 PM
CLOVIS closed this revision.May 15 2019, 8:29 PM