Open mrnugget opened 3 years ago
+1, adding one more use case here user: +1 for the problem and solution proposed here from https://github.com/sourcegraph/accounts/issues/6859
In a monorepo structured by package
app
--- x
|--- package-info.java
|--- y2
|---package-info.java
|--- y1
|---package-info.java
rootAtLocationOf
is not flexible enough, there is a package-info.java in all subpackages, which creates too many changesetsAll subdirectories of app of depth 1
group:
- directory: app/*
changesetTemplate:
branch: batch-changes/-${{ replace steps.path "/" "-" }} # generate unique branch name with path
All subdirectories of app of depth 2
group:
- directory: app/*/*
changesetTemplate:
branch: batch-changes/-${{ replace steps.path "/" "-" }} # generate unique branch name with path
Thanks @malomarrec!
Add glob syntax to directory
Another idea here – perhaps a regex syntax with capture groups could be more flexible, but still clear?
The idea would be to just search for files / directories, using a regex with some capture groups. Every workspace would be defined by the tuple of captured values.
Example: /root-project/(lib-data-.*)/src/(module-.*)
to generate one workspace per module of a "data" library.
We don't have a need for something like this now, but it occurred to me as a possibility. I think this approach is very flexible, but still not overcomplicated.
Just wanted to say that for our csharp codebase it would be enormously helpful to target something like the <directory-path>\*.csproj
. In csharp, there isn't an obvious single filename I can think of that I could target for every project.
@NickChoiRBX thanks for the feedback here. If you had to write a script to define what a project
is, what would that be (feel free to DM me or reply here)!
A monorepo use case from https://github.com/sourcegraph/accounts/issues/6859
There is a repo with Terraform files. The user runs sed
commands to upgrade to the next Terraform version.
Workspaces are grouped by cloud account, then by service
aws-acct-1
project-1
project-2
project-3
aws-acct-2
project-1
project-2
project-3
gcp-acct-1
project-1
project-2
azure-acct-1
project-1
project-2
A workspace is azure-acct-1/project-1
for example. The use case is:
The ideal situation would be:
(aws|gcp)-.*/.*
.
An acceptable situation would to just list out glob type path:
-aws-acct-1/*
-aws-acct-2/*
Subsumed into #28246 and RFC 574 WIP: Make Batch Changes work for common monorepo structures
(Just replicating what I wrote in Slack here so we don't lose it)
In more concrete terms: in addition to having this
we could have something like this: