Repository navigation
Conversation
joe0BAB
force-pushed
the
replacen
branch
2 times, most recently
from
January 29, 2026 13:27
adaceaf to
4e9669d
Compare
joe0BAB
commented
Jan 29, 2026
joe0BAB
commented
Jan 29, 2026
Benehiko
reviewed
Jan 29, 2026
| if len(candidates) != 1 { | ||
| return "", errors.New("invalid") | ||
| } | ||
| components[candidates[0]] = other |
Member
There was a problem hiding this comment.
now that we only have 1 replace wouldn't this end up like:
pattern: docker/**/bar/**
input ID: bob
output: docker/bob/bar/**
Collaborator
Author
There was a problem hiding this comment.
So we could implement what you're describing, but right now it isn't. Instead if the candidate positions where we could replace are not equal 1, we return an error.
I'm hesitant to do this as eg the following could be a bit surprising:
pattern: docker/**/bar/**
input Pattern: bob/**
output: docker/bob/**/bar/**
🤷
Collaborator
Author
There was a problem hiding this comment.
It also complicates things as with
pattern: docker/**/bar/**
input ID: bob
output: docker/bob/bar/**
you're converting an ID into a pattern. Then it wouldn't be ExpandID(ID) (ID, error) anymore.
Member
There was a problem hiding this comment.
yes, i was asking if the output would be not should be.
Benehiko
approved these changes
Jan 30, 2026
joe0BAB
pushed a commit
that referenced
this pull request
Feb 16, 2026
feat: (generic realm) expansion
joe0BAB
pushed a commit
that referenced
this pull request
Feb 16, 2026
feat: (generic realm) expansion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want a generic logic that allows to "resolve a realm".
Example: Let
docker/auth/**be a realm. Then, the pattern query**/fooshould get resolved todocker/auth/**/foo.We can define
**to be a generic realm. Then this reframes our problem into a "generic realm replacement problem".As there could be
ngeneric realms, more generally speaking we can view this a "replace n" problem where we have a component string and up tonrealm markers**that should be replaced.