Skip to content
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

Simple hosts masks. Question. #604

Open
timurhai opened this issue May 11, 2024 · 6 comments
Open

Simple hosts masks. Question. #604

timurhai opened this issue May 11, 2024 · 6 comments
Assignees
Milestone

Comments

@timurhai
Copy link
Member

I think it will more handy if consts mask will use "contain" not "match".
If "contain" you can just write my-blade and not my-blade.* to render on all my-blade-###.
It is more user-friendly, I think.

In most cases regular expressions are not needed.
We can just "find" some string, and not run heavy std::regex::match function.
It will work tens times faster.

We can add an option, use "regex" or just "find". It can be a user or (and) job parameter.

Also we can use "find" with "split" by "|" (or just space or comma):
my-blade|his-blade will run on my-blade-### and his-blade-### without regular expressions.

What do you think?

@timurhai timurhai added this to the 3.4.0 milestone May 11, 2024
@timurhai timurhai self-assigned this May 11, 2024
@sebastianelsner
Copy link
Contributor

Yes, this is mostly how we use hostmasks, BUT we have a few cases where advanced users actually use regexes to pick out specific hosts they want. So, if you make this a global config flag, we will need to leave this to the more complex regex setting until we find a a good way to make all the users happy.

I think this is valuable but for us it comes with a long migration path.

@timurhai
Copy link
Member Author

Job can have a parameter (flag) use complex regex or simple "find".

@sebastianelsner
Copy link
Contributor

Sounds good!

timurhai added a commit that referenced this issue Oct 14, 2024
Now find function is used to match hosts mask and hosts exclude mask.
This is the default behaviour for user, job and branch.
You can configure user, job and branch to use Regular Expressions.
If a new job does not have hosts_mask_type parameter, user host mask
type will be used.

References #604.
@timurhai
Copy link
Member Author

Now find function is used to match hosts mask and hosts exclude mask.
This is the default behaviour for user, job and branch.
You can configure user, job and branch to use Regular Expressions.
If a new job does not have hosts_mask_type parameter, user host mask
type will be used.

ps
Should be (and will be) tested on a real work.

@sebastianelsner
Copy link
Contributor

Nice, does it already include the splitting at "|"?

@timurhai
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants