Fork me on GitHub
#polylith
<
2023-08-14
>
Jim Riordan01:08:20

hi all, what's the best course of action to submit fixes for errors in the gitbook documentation? it seems the https://github.com/polyfy/polylith/issues/318?

seancorfield01:08:22

That's why the gitbook stuff is moving to here https://github.com/polyfy/polylith/tree/issue-318/doc (note: the issue-318 branch).

seancorfield01:08:11

You can open regular issues on the polylith repo for documentation problems, and issue 318 is completed and merged, you'd be able to provide PRs to, if you want.

Jim Riordan01:08:23

thank you kindly

seancorfield01:08:21

(I think Joakim is only planning to move the tool docs to the GH repo -- the high-level overview docs may stay in GitBook for the time being... but I hope that all moves too at some point)

tengstrand02:08:41

Yeah, I've been working on this switch for quite a while now. When it's ready to be pushed to master, a 0.2.18-SNAPSHOT versions of the documentation will be available on clojars (and updated versions of that snapshot when more issues are included in the release) before the 0.2.18 is released, so be patient for a little while longer!

tengstrand02:08:17

My English is not perfect unfortunately, so I will let an English speaker go through all the documentation before it's merged into master. I'm still working on it, but if you @U05HNU149J9 or anyone else here feels they want to help out with that work, don't hesitate to contact me!

j1mr10rd4n02:08:30

yes, i’d be happy to help out in the meantime i opened https://github.com/polyfy/polylith/pull/324 on the https://github.com/polyfy/polylith/tree/issue-318 branch - a namespace mismatch that had me scratching my head until i cross-referenced it with the example code

tengstrand03:08:29

Okay, cool, and thanks for the PR!

octahedrion14:08:23

I'm new to polylith, how do people work on multiple branches (of a monorepo) for different libraries inside a monorepo at once ? I would like to be able to checkout one branch to work on one library and another branch to work on another library at the same time

Brennan C.14:08:38

I'd create a 3rd branch and merge/rebase in the two branches I was interested in.

octahedrion14:08:33

ok maybe I didn't describe what I want well enough. In the same editor I'd like to be able to work on two libraries (components, or bases, I guess in polylith terms) of a monorepo at once, alternating between the two as I please, but if I want to work on two different branches of that monorepo, one for each library, then I can't because I can only check out one at a time

tengstrand14:08:49

So you would like to switch between two different versions of a component?

octahedrion14:08:00

no, between one branch of the whole monorepo to work on one component, and another branch to work on another component

tengstrand14:08:17

I know that you can do such things in git, to check out one directory from one branch (or even a different repo). I haven’t tried it out myself, so I don’t remember the syntax. I will be busy in a few minutes, so I don’t have time to check it out for you, unfortunately.

seancorfield16:08:11

@U0CKDHF4L IMO, that kind of goes against the whole ethos of a monorepo -- you want everything consistent so you want a single branch with your changes on...

tengstrand19:08:08

It would be interesting to hear about your use case @U0CKDHF4L.

octahedrion07:08:21

only one branch ? what about components in development which aren't ready for deployment to production ?

tengstrand08:08:47

Let's say we keep what's in production in the master branch. When we want to work on new functionality, we may create an issue in GitHub, and then we create a branch based on master e.g. issue-123. Now the code in that branch will look exactly the same as in master (including all our components) which means that we can make changes in the issue-123 branch without affecting master. When we feel we are ready with your changes, e.g. updated component x, then we merge issue-123 into master and deploy master to production. Did that answer your question?

octahedrion09:08:33

I had gathered that much, but I'm used to having several different projects open, being able to switch between different branches as I please

tengstrand10:08:03

Maybe a solution is to have a cloned repo per branch, each in a separate directory.

octahedrion10:08:06

I had dismissed that idea for its ugliness

octahedrion10:08:20

I get now though, Polylith enforces a linear synchronous working style

seancorfield15:08:18

> I'm used to having several different projects open, being able to switch between different branches as I please Polylith is a monorepo system so you only have one project open that contains "everything". You can still switch between different branches, but the whole monorepo switches. On each branch, the whole monorepo is self-consistent. You no longer have the multi-version "assembly" aspect to deal with -- just a given version of "everything" at any point in time.

greg20:08:23

Hey, I've been evaluating polyliyh for a while, and recently I got pleasure to work with it on production and I got a couple of questions: 1/ Isn't the idea of having one REPL for multiple project a good recipe for loosing parity between REPL environment and prod/dev running environments from deps perspective? Even if we ensure same version of dependencies across all projects/components/bases in the monorepo, the fact that we use different set of deps in each project, affects resolution of transitive dependencies. In result we might encounter situation that our deps behave differently in REPL and differently when deployed? Please correct if I'm wrong.

seancorfield20:08:46

We have profiles for places where the actual dependencies matter (which, for us, is primarily about whether the code runs on JDK 8 for one legacy app or JDK 20 for everything else). Nearly all the (3rd party) deps -- libs -- are specified in bases/components as needed by their code with only a few deps specified in projects.

greg15:08:24

I'm not sure we are talking about the same thing. If we have a regular project and accompanying REPL to it, the dependency graph should keep parity (subject to change if you apply aliases - but aliases is something that explicitly screams "I'm going to alter your deps, expect changes"). While, with polylith we kind of diverge REPL dependency graph from prod's dependency graph (ending up with potentially different behaviour). The Rich's "Spec-ulation" talk refers to the problem of deps uncertainty. To me, polilyth, at the current design, invites disparity of dependencies/classpaths. I can be wrong though. Just wanted to post it in case someone thought already about it and share more reflections on this potential problem.

seancorfield17:08:16

I don't follow you... when you build an artifact (application) from a Polylith monorepo, it's built from a single, consistent view (version) of the entire repository. There's no disparity there. Could you explain your concerns differently?

seancorfield17:08:45

poly test is based on projects, so it tests what gets built.

greg17:08:31

I'm sorry. I don't have extensive experience with polylith and I haven't yet a demo project validating my concerns. I still consider I can be wrong. An artifact is built from within a project, while REPL starts from root. The dependency graph used by REPL is then bigger then of a project. That led me to conclusion that evaluating things within a REPL in polylith we can't have certainty we are using the exactly same set of dependencies as the production running artifact.

seancorfield18:08:05

In practice, the REPL dependencies are nearly always a pure superset of any given project's dependencies so it's almost never a concern (see my comments about profiles previously for a specific way to deal with known differences in versions).

seancorfield18:08:05

Like I say, we work with a REPL started from :dev:test with 140k lines of code in 160 bases/components building 20 projects at work and it's fine.

greg20:08:32

2. What are the sizes of your teams?

greg20:08:18

3. Do you store a polilyth stuff: a) in literally one repo b) in multiple repos wired with submodules c) in multiple repo but wired with google repo or similar tool d) some other way?

seancorfield20:08:20

A single monorepo -- with 140k lines of Clojure and about 160 bases/components.

kjothen14:08:06

In our case, a single monorepo with just 16k lines of Clojure and 22 bases/components, but rapidly growing! I would be really interested to hear how teams handle CI builds in general under polylith. for instance, when component code changes, how do you just build the dependent projects? Do teams have a build step which moves a github stable tag or the like such that affected subsequent tests only are run? How do you know which projects this affected and that these need to be built (usually as uber jars and docker images)? We use github actions/workflows. I would rather not maintain the list of component paths in each of my project-level github workflows when that information is already in my project deps.edn, but it’s what I currently do…

seancorfield17:08:43

@U0505U3TS90 I blogged about that: https://corfield.org/blog/2022/12/07/deps-edn-monorepo-10/ -- see "Polylith to the rescue, part 4" specifically.

seancorfield17:08:20

Happy to answer any specific Qs you may have after reading that...

🙌 2
kjothen20:08:35

Yes, after revisiting your blog I can see you’ve already solved what I think most teams need. Afterall, one of the benefits of monorepos in general, such as Basel, is the incremental build capability that leverages explicit build dependencies. Now we can do this with Polylith on any version control system, which is neat. Thanks!

2