-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add support for multiple workspaces #431
Comments
Hi @tengstrand! Having this feature in Polylith will be awesome! I remember our discussion about this in Slack just a few months ago. The pace of recent developments is astonishing. Kudos to you, Sean, Furkan and Lee Read! One quick question, if you don't mind. Could you, please, hint at how this sub-feature can be useful? What can it give?
|
Thank you for the kind words @marksto!
This is an idea I currently have, which would allow you to override e.g. test configuration settings. Another option is that each workspace only specify the workspaces they use, within their own |
My current idea is that each workspace.edn will have a
This means that every workspace will be self contained when it comes to configuration, and we don't need an omnipotent configuration file at the root of the workspace, as we discussed in ClojureScript support. |
Preparation work on issue #431. * Added the example projects multiple-workspaces1 and 2. * Let each workspace define which workspaces they depend on (if any). Work in progress. * Changed how we refer to workspaces. * Moved in the workspace-clj component into the workspace component. * Centralised how we read workspaces from disk/file. * Changed version to 0.2.20-SNAPSHOT. * Replace config:workspaces with config:workspace (only store config for current workspace here).
@tengstrand, hmm, so using relative paths for wss effectively means they also can successfully end up not being nested? I.e. having the following one-level file structure:
|
Yes, that's the idea. |
issue #431 * 0.2.20-SNAPSHOT #8 * Extract test code from the 'changes' component to the 'test' component. (#449) * Refactor code from the 'changes' component to the new 'test' component. * Add more test to catch if the code that calculates which tests to run breaks. * Update libraries to the latest version.
Extract :interface-deps in bricks from other workspaces. Change from dir-via to ddir, and from file-via to ffile in switch-ws. 0.2.20-SNAPSHOT (11). Issue #431 (work in progress)
Issue #431 * Exclude namespace from the API. * Update portal to the latest library version. * Remove Funnel from list of production systems (they have stopped using Clojure). * Add link from :test in Configuration to Test runners page. * Only show 'with' in ws and test, if :test-configs is configured in workspace.edn. * Added merge-test-config test. * Bump djblue/portal to 0.54.2. * 0.2.20-SNAPSHOT #14
* 0.2.20-SNAPSHOT #16 * Added issue #431 to the list of issues. * Show external bricks correctly in the info command. * Don't show warning 207 "Unnecessary components..." for external components. * Exclude external bricks from the list of libraries in the libs command. * Remove Funnel as example system.
Revert support for multiple workspaces, issue #431.
👏🏻 |
Today it's possible to have multiple workspaces in a monorepo, and to share code between them, by using the
:local/root
syntax. However, the poly tool handles references to bricks like any library, and not like bricks. As a result, they are not included in the dependency calculation, and changes to a brick from another workspace will not trigger a test run + they are not listed in theinfo
command as bricks, just as libraries.To get this to work, we need to include all bricks and projects from all workspaces in all the calculations. Here is an idea of how that could be implemented. We could add a
:full-name
attribute to bricks and projects, that includes the alias of the workspace, e.g.myws/mybrick
. An idea is to use namespaced keywords, like:myws/mybrick
, which would make it easy to pick out both the name with(name full-name)
and the namespace with(namespace full-name)
.The workspace structure is already prepared to support multiple workspaces. The current workspace is stored in the
:workspaces
vector as a single element. When we add support for multiple workspaces, all workspaces can be stored here, and each of them can have an alias, which would be the workspace name (the name of the workspace directory) if not given.For the different commands lik
info
,libs
, anddevs
to work nicely, we could tell the tool which workspace is current. Let's say the current workspace isws1
which refers to bricks inws2
. Then the the different commands, like theinfo
command, would not prefix thews1
workspace, but bricks inws2
would show the prefix. Theinfo
command will show the current workspace, and a list of workspaces and their aliases, and maybe the relative path to the root of them.At the root of the repository, we could have a
polylith.edn
config file, that specifies all the workspaces to include, and which one is current. It could look something like:If the
path
is set to "." then the name of the repository will be used as workspace name (just as today).If we s upport overriding settings, then we could specify the same workspace several times, but with different aliases. This is something that we may skip in the first iteration, but could be good to think about.
All bricks, projects, and profiles will be stored together in
:bricks
,:projects
, and:profiles
as today, but they will also include:ws-alias
. If we use the alias instead of workspace name, it becomes possible to support that a workspace is used more than once, but with different settings.When this issue is implemented, it will be a lot easier to add support for cljs.
The text was updated successfully, but these errors were encountered: