Skip to content

Backport fix for workspace globbing#664

Merged
eseliger merged 2 commits into
mainfrom
es/workspaces-fix
Nov 29, 2021
Merged

Backport fix for workspace globbing#664
eseliger merged 2 commits into
mainfrom
es/workspaces-fix

Conversation

@eseliger

Copy link
Copy Markdown
Member

@eseliger eseliger requested a review from mrnugget November 26, 2021 13:18

@LawnGnome LawnGnome left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but same caveat as the main repo approval.

for _, conf := range spec.Workspaces {
g, err := glob.Compile(conf.In)
in := conf.In
// Empty `in` should fall back to matching all, instead of nothing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but just wanted to mention it: we could also define something like

type allMatcher struct{}
func (a allMatcher) Match(_ string) bool { return true }

and pass that in when in == "" since it satifies glob.Glob. We'd save a glob.Compile.

Comment thread internal/batches/service/workspaces_test.go Outdated
@eseliger eseliger merged commit eea180c into main Nov 29, 2021
@eseliger eseliger deleted the es/workspaces-fix branch November 29, 2021 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants