--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Google Germany GmbH, Erika-Mann-Strasse 33, 80363 Munich
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
In a big series I have going, I've been splitting up the //gerrit-server:server target and moving stuff around between packages & top-level directories. There are still plenty of incremental improvements that can be made, but I'm wondering if we should also think about how to completely rearrange the directory layout.The current layout of having gerrit-* directories with separate java source trees dates back to the bad old days of Maven, when this specific layout was necessary to decompose the build into separate pom.xml files. This is no longer a requiement.Here are some issues with the current layout:* A single gerrit-*/BUILD with many rules globbing separate subdirectories makes BUILD files messier, since we have to extract various srcs lists as top-level constants and exclude them from other rules.
* Different gerrit-* directories occasionally contain sources in the same java package, despite the java_library rules being completely separate.* In general, if you're adding a new class, it's hard to tell which top-level directory it belongs in, unless you are already quite familiar with the package hierarchy.That said, there are also some advantages:* Top-level directories give a hint as to what kind of external dependencies are brought in: gerrit-httpd depends on Jetty, gerrit-cache-h2 depends on H2, gerrit-gwt-* depends on GWT.* Each artifact published on Maven Central corresponds to a single top-level directory: gerrit-war, gerrit-plugin-api, gerrit-extension-api.
A simpler layout would be something like we use internally at Google with Blaze:* java/com/google/gerrit/... contains Java sources and resources* javatests/com/google/gerrit/... contains Java tests* BUILD files exist as close to the *.java files referenced in their rules as possible (our acceptance tests already do this)* other top-level directories (lib, polygerrit, tools, etc.) stay the same.Thoughts?
Once we agree on an end goal, we can talk in more detail about how we get from here to there :)
On Thursday, August 10, 2017 12:32:38 PM 'Dave Borowitz' via
Repo and Gerrit Discussion wrote:
> Here are some issues with the current layout:
> * A single gerrit-*/BUILD with many rules globbing
> separate subdirectories makes BUILD files messier, since
> we have to extract various srcs lists as top-level
> constants and exclude them from other rules. * Different
> gerrit-* directories occasionally contain sources in the
> same java package, despite the java_library rules being
> completely separate. * In general, if you're adding a new
> class, it's hard to tell which top-level directory it
> belongs in, unless you are already quite familiar with
> the package hierarchy.
Yes, the current layout is difficult, part of the balme lies
with long java package names, not just the build system.
But not just the package names, also the src/main/java
prefixes that sit in front of the already long package names.
And part of the problem is not just the length of the names,
but the number of divisions, each extra directory results in
one more click or one more tab completion for developers.
+1 for seeking improvements!
> That said, there are also some advantages:
> * Top-level directories give a hint as to what kind of
> external dependencies are brought in: gerrit-httpd
> depends on Jetty, gerrit-cache-h2 depends on H2,
> gerrit-gwt-* depends on GWT.
This is indeed a strong advantage, how would a new layout
deal with this?
Thanks to David for taking the baton and running with it. I think we can start reviewing/submitting this topic as soon as we cut the 2.15 release branch.
I'd also like to clarify the proposal around test utilities, continuing in the vein of matching the Gerrit layout to what we use internally at Google:* Test utilities go in the java tree; specifically, tests for subpackage foo go in java/com/google/gerrit/foo/testing* java_library rules for test utilities get testonly = 1* Tests for subpackage foo go in javatests/com/google/gerrit/foo* Tests for test utilities go in javatests/com/google/gerrit/foo/testing
Thanks to David for taking the baton and running with it. I think we can start reviewing/submitting this topic as soon as we cut the 2.15 release branch.
I'd also like to clarify the proposal around test utilities, continuing in the vein of matching the Gerrit layout to what we use internally at Google:* Test utilities go in the java tree; specifically, tests for subpackage foo go in java/com/google/gerrit/foo/testing* java_library rules for test utilities get testonly = 1* Tests for subpackage foo go in javatests/com/google/gerrit/foo* Tests for test utilities go in javatests/com/google/gerrit/foo/testing
Am Dienstag, 12. September 2017 14:49:21 UTC+2 schrieb Dave Borowitz:Thanks to David for taking the baton and running with it. I think we can start reviewing/submitting this topic as soon as we cut the 2.15 release branch.I would like to suggest to merge the whole series or a part of it before cutting 2.15 stable branch.As David Pursehouse pointed out in this comment the CI is blocked for very long time afterthe rebase of ca. 50 changes (12+ hours), and beside that, the rebase is not trivial at all.For big changes, like dissolve gerrit-sever top-level directory, i gave up the rebase attempt andimplemented the move second time.Another reason to do it before 2.15:2.14.4 was released today morning. So that 2.14 should be stable by now. For 2.15 I would expectmore activity to port changes from master. After the refactoring of directory structure, this would bemore work and harder to do.
I'd also like to clarify the proposal around test utilities, continuing in the vein of matching the Gerrit layout to what we use internally at Google:* Test utilities go in the java tree; specifically, tests for subpackage foo go in java/com/google/gerrit/foo/testing* java_library rules for test utilities get testonly = 1* Tests for subpackage foo go in javatests/com/google/gerrit/foo* Tests for test utilities go in javatests/com/google/gerrit/foo/testingDone. I've sent you the changes for review.
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
Moreover, talkingabout this series, that is immediately outdated and has merge conflicts,the last changes in the series are not even verified, because (to save CIresources), the CI flow was restricted to only verify changes that don't have conflicts.@Luca, can we relax this restriction until this series is merged andverify changes even with merge conflicts?
> What is your definition of big changes? This series is a
> no-op!
Was that sarcastic? If not, I think you answered your own
question below. :)
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
PolyGerrit went through something similar just after 2.14 was released. We migrated all the javascript to ES6, touching most of our lines of code. Fortunately we didn't have to move any files, nor was our code so critical as to need the same sort of strong stability guarantees or as much cherrypicking, but it was a complication.
R | java/com/google/gerrit/httpd/auth/oauth/OAuthSession.java gerrit-oauth/src/main/java/com/google/gerrit/httpd/auth/oauth/OAuthSession.java | 0 |
Perhaps the best time to do this sort of thing is midway between releases, when cherrypicks are rare and there is time before the next release to guarantee stability. I don't think it's reasonable for anyone to try to maintain this series for so long, though. It seems like the question is, can it be put down and picked up again later?
On Friday, September 22, 2017 12:20:00 PM David Ostrovsky
wrote:
> Conclusion: Dissolving of top-level directory structure is
> a no-op change that produces the same binary.
This is very good news.
You mentioned developer tools integration (eclipse), but
what else should we be concerned with? Release tools?
Plugins, in and out of tree? Plugins that still use maven,
buck (I suspect there are still many)?
Am Dienstag, 12. September 2017 14:49:21 UTC+2 schrieb Dave Borowitz:Thanks to David for taking the baton and running with it. I think we can start reviewing/submitting this topic as soon as we cut the 2.15 release branch.I would like to suggest to merge the whole series or a part of it before cutting 2.15 stable branch.As David Pursehouse pointed out in this comment the CI is blocked for very long time afterthe rebase of ca. 50 changes (12+ hours), and beside that, the rebase is not trivial at all.For big changes, like dissolve gerrit-sever top-level directory, i gave up the rebase attempt andimplemented the move second time.Another reason to do it before 2.15:2.14.4 was released today morning. So that 2.14 should be stable by now. For 2.15 I would expectmore activity to port changes from master. After the refactoring of directory structure, this would bemore work and harder to do.
I'd also like to clarify the proposal around test utilities, continuing in the vein of matching the Gerrit layout to what we use internally at Google:* Test utilities go in the java tree; specifically, tests for subpackage foo go in java/com/google/gerrit/foo/testing* java_library rules for test utilities get testonly = 1* Tests for subpackage foo go in javatests/com/google/gerrit/foo* Tests for test utilities go in javatests/com/google/gerrit/foo/testingDone. I've sent you the changes for review.
Not going to comment on the rebase hell that David is going through (sorry) or the potential for instability leading up to a release (which sounds like a non-issue given that it produces the same war).From my (Google's) perspective, a bigger blocker than the 2.15 cut is redoing our internal build. But I think it might not actually be that bad, and I will take a crack at it today or tomorrow morning.
On Thu, Sep 21, 2017 at 10:32 AM, David Ostrovsky <david.o...@gmail.com> wrote:
Am Dienstag, 12. September 2017 14:49:21 UTC+2 schrieb Dave Borowitz:Thanks to David for taking the baton and running with it. I think we can start reviewing/submitting this topic as soon as we cut the 2.15 release branch.I would like to suggest to merge the whole series or a part of it before cutting 2.15 stable branch.As David Pursehouse pointed out in this comment the CI is blocked for very long time afterthe rebase of ca. 50 changes (12+ hours), and beside that, the rebase is not trivial at all.For big changes, like dissolve gerrit-sever top-level directory, i gave up the rebase attempt andimplemented the move second time.Another reason to do it before 2.15:2.14.4 was released today morning. So that 2.14 should be stable by now. For 2.15 I would expectmore activity to port changes from master. After the refactoring of directory structure, this would bemore work and harder to do.Is that really true? Shouldn't `git cherry-pick` work across moves? Can you try, as an experiment, making a content change on top of your series (simulating post-2.15 master) and cherry-picking onto master (simulating stable-2.15)?
On Sunday, September 24, 2017 at 9:08:08 PM UTC+2, Dave Borowitz wrote:Not going to comment on the rebase hell that David is going through (sorry) or the potential for instability leading up to a release (which sounds like a non-issue given that it produces the same war).From my (Google's) perspective, a bigger blocker than the 2.15 cut is redoing our internal build. But I think it might not actually be that bad, and I will take a crack at it today or tomorrow morning.Beside the aspect of redoing your internal build, can someone from Gerritteam @Google start to review the series?
I asked Damien Martin-Guillerezfrom Bazel team to help with the review of this series, but he deferred thereview process to Gerrit team @Google.Another option is to do what Logan suggested, abandon this series for now,and proceed with it later (I have a long vacation starting at the end of thenext week).
On Thu, Sep 21, 2017 at 10:32 AM, David Ostrovsky <david.o...@gmail.com> wrote:
Am Dienstag, 12. September 2017 14:49:21 UTC+2 schrieb Dave Borowitz:Thanks to David for taking the baton and running with it. I think we can start reviewing/submitting this topic as soon as we cut the 2.15 release branch.I would like to suggest to merge the whole series or a part of it before cutting 2.15 stable branch.As David Pursehouse pointed out in this comment the CI is blocked for very long time afterthe rebase of ca. 50 changes (12+ hours), and beside that, the rebase is not trivial at all.For big changes, like dissolve gerrit-sever top-level directory, i gave up the rebase attempt andimplemented the move second time.Another reason to do it before 2.15:2.14.4 was released today morning. So that 2.14 should be stable by now. For 2.15 I would expectmore activity to port changes from master. After the refactoring of directory structure, this would bemore work and harder to do.Is that really true? Shouldn't `git cherry-pick` work across moves? Can you try, as an experiment, making a content change on top of your series (simulating post-2.15 master) and cherry-picking onto master (simulating stable-2.15)?Indeed, you are right. I tried to cherry-pick one trivial change: [1]that I applied on top of this refactoring series, and cherry-pick onmaster (with old directory structure) just worked.
On Sun, Sep 24, 2017 at 10:38 PM, David Ostrovsky <david.o...@gmail.com> wrote:
On Sunday, September 24, 2017 at 9:08:08 PM UTC+2, Dave Borowitz wrote:Not going to comment on the rebase hell that David is going through (sorry) or the potential for instability leading up to a release (which sounds like a non-issue given that it produces the same war).From my (Google's) perspective, a bigger blocker than the 2.15 cut is redoing our internal build. But I think it might not actually be that bad, and I will take a crack at it today or tomorrow morning.Beside the aspect of redoing your internal build, can someone from Gerritteam @Google start to review the series?I will review it as part of redoing the internal build.To be completely honest, what I was going to do was just start with the BUILD files in the tree at the tip of the series, and tweak them in-place to handle the bazel->blaze conversion. So I'll be reading the files closely anyway.I asked Damien Martin-Guillerezfrom Bazel team to help with the review of this series, but he deferred thereview process to Gerrit team @Google.Another option is to do what Logan suggested, abandon this series for now,and proceed with it later (I have a long vacation starting at the end of thenext week).Would you be offended if we worked on this at the hackathon?
Maybe you'll come back from your vacation and it will all be merged ;)
Not going to comment on the rebase hell that David is going through (sorry) or the potential for instability leading up to a release (which sounds like a non-issue given that it produces the same war).From my (Google's) perspective, a bigger blocker than the 2.15 cut is redoing our internal build. But I think it might not actually be that bad, and I will take a crack at it today or tomorrow morning.
On Sun, Sep 24, 2017 at 3:07 PM, Dave Borowitz <dbor...@google.com> wrote:Not going to comment on the rebase hell that David is going through (sorry) or the potential for instability leading up to a release (which sounds like a non-issue given that it produces the same war).From my (Google's) perspective, a bigger blocker than the 2.15 cut is redoing our internal build. But I think it might not actually be that bad, and I will take a crack at it today or tomorrow morning.I spent a couple hours on our internal build today and made good progress. I think we should be able to complete this during the hackathon.I need to take another look at the blocking issues for 2.15 and see whether it's feasible to get it all done during the week before I leave for London.
I ran into a nontrivial issue that I commented on here:
I think I don't have the further time to work on this before the hackathon, unfortunately.
It's not looking very good for getting in 2.15.
I don't think that's a result of rearranging the directory structure. The only test of which DeleteBranchesIT.java is a src is //javatests/com/google/gerrit/acceptance/rest/project:rest_project. The package name is different, but the BUILD file is the same:I think something else is wrong with either our dependency graph or your bazel settings.
2017-11-10 15:54 GMT+01:00 Edwin Kempin <eke...@google.com>:On Fri, Nov 10, 2017 at 3:32 PM, דוד אוסטרובסקי <david.o...@gmail.com> wrote:2017-11-10 15:07 GMT+01:00 Dave Borowitz <dbor...@google.com>:I don't think that's a result of rearranging the directory structure. The only test of which DeleteBranchesIT.java is a src is //javatests/com/google/gerrit/acceptance/rest/project:rest_project. The package name is different, but the BUILD file is the same:I think something else is wrong with either our dependency graph or your bazel settings.Right. Moreover, the dependency graph remained (almost) the same after the refactoring://javatests/com/google/gerrit/acceptance/rest/project:rest_project => acceptance/framework => gerrit/server => restSo I fail to see (I do not have access to my machine atm), how changing sources from project:rest_projectwould cause re-build or re-test of the entire world.OK. Would be nice to know if I'm the only one seeing this issue or if it's reproducible on other machines.I was able to reproduce it. As expected, that problem has nothing to dowith re-arranging of directory structure series.
The problem you've discovered is a regression of: [1], that was not cherrypicked to stable-2.15. So, as always, it is a good idea to report an issue inissue tracker.
Why this change has such consequences?This has something to do with how stamping is implemented in Bazel.- Every time you run bazel build foo (or bazel test bar)bazel workspace status command is unconditionaly executed- cat tools/bazel.rcbuild --workspace_status_command=./tools/workspace-status.sh- in the end this line from ./tools/workspace-status.sh is executedgit describe --always --match "v[0-9].*" --dirtyand the output is written to bazel-out/volatile-status.txt and bazel-out/stable-status.txt- Because your git tree was clean, and you've changed one file,the content of the version was changed to something like:v2.15-rc2-892-g22a6c6e2b3-dirty- As the consequence, //:version is rebuilt- As the consequence, because since [1]java/com/google/gerrit/common:server depends on //:version,the common/server.jar was rebuilt and got new resource file:cat ./com/google/gerrit/common/Versionv2.15-rc2-892-g22a6c6e2b3-dirty- As the consequence, all tests are re-executed.
There are two major use cases to consider here:Scenario I: (You hit that one)a) Start from clean git treeb) run bazel test //... => all tests are executedc) touch no matter what file in the treed) re-run bazel test //... => all tests are re-executed because theversion changed from say v2.15-rc2-892-g22a6c6e2b3 to v2.15-rc2-892-g22a6c6e2b3-dirtyScenario II:a*) start from non clean tree, say version is: v2.15-rc2-892-g22a6c6e2b3-dirtyb*) run bazel test //... => all tests are executedc*) change javatests/com/google/gerrit/acceptance/rest/project/DeleteBranchesIT.java filed*) re-run bazel test //... => only one test rule is re-executed://javatests/com/google/gerrit/acceptance/rest/project:rest_projectI think, we should re-consider: [1] implementation and try to move the version testsin different place in the dependency graph, so that Scenario I only affects very fewtests.Another option would be to change tools/workspace-status.sh to always generatesay "dev" string and not consult `git describe ...` in development tree.