-
Notifications
You must be signed in to change notification settings - Fork 34
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 ability to skip building module #83
Comments
Sounds reasonable. Not sure if you have seen this, but there's already a feature to do the reverse. What do you think about Is the motivation behind In terms of the behaviour of this command, are we thinking of just excluding the specified modules? What about their dependents (that haven't been modified but marked for build because of the changes to dependencies?). |
I'm thinking that an I think further consideration is required so that this feature could benefit most pipelines without requiring some sort of funny hack to skip building something because it is not ready. How it is implemented on my end was as part of the build process, the CI would check for the presence of a file and if the file exists, automatically mark as complete and move on. Modules that depend on the skipped module will naturally fail since it cannot access a function / artifact from the skipped module. Though we do have modules that does not explicitly require the skipped module and could still continue building (e.g. docker images since unavailable locally due to a skipped build will be pulled from our private registry instead). Hope this provides some clarity. |
Thanks for the detailed explanation. I've been giving some thought into this and definitely think this feature should go into the product. May be the details of how to handle the dependencies etc would fall out if we discuss the scenarios that would benefit from this. One scenario I could think of is, when we have different pipelines for sub-trees. For example, consider a setup like this:
If we don't want to trigger the pipeline for IMHO, model like this would be a bit more predictable than Hopefully am I not going off track here? Are you able to share the details of your scenario? |
@dustyhorizon Sorry, re-reading this thread clarified your use case.
In this case, I like the idea of storing this instruction in a file. Could we use a new property in spec ( Something like:
And at build time by default, we exclude all modules with I think skipped modules (or their dependents) should not be considered during Finally, I think a switch Keen to hear your thoughts around not building the whole chain. |
Sorry for the late response, my use case was that for example when I am developing new modules / images, sometimes I do not want them to be built as they are incomplete. I would preferably have mbt manage the DONOTBUILD part and hence this feature request. Currently I am doing a roundabout method of checking if a file exists and if so, instantly complete the build for that module (a Makefile was involved so checks coule be done / complete builds if skipped). I suppose its ugly but it works haha. The exclude flag for mbt would be ideal, I am thinking if someone have depended on a excluded module it should fail fast as it could produce incomplete artifacts? Maybe an additional flag |
@dustyhorizon Thanks for further input. This is a reasonable request and I've already marked it as an enhancement (which is an indication that this would be added in a future release). Failing the build might not be desirable in some situations. For example, if you don't have a good QA process for your PRs, a simple misconfiguration in mbt file could lead to broken master. That's why I thought excluding the entire dependency chain would more forgiving. In build summary, we can output the list of skipped modules and the reason for skipping to make it more obvious to the user. One of the main goals of mbt is to make repositories describe modules using the metadata stored within. We could then use that metadata to generate various documents such as deployment manifests as of a particular commit sha. If we introduce an Let me know if this makes sense. PS: Did you consider simply not creating |
Haha actually the hacky skip feature was in place before I found out about mbt and I really wanted break away from these hacky fixes hence the feature request. Thanks for the hard work though! Understand where you are heading with regards to the |
With a differential build flow set up, sometimes there is a need to not build a particular module. It would be good to have flag / file based token to indicate that this module although defined and with changes, there is no need to build it.
A possible implementation would be to add a
--skip
flag but that would require changing the CI script everytime. An alternative is to check for a .mbt_skip_module file at the module root and if the file exists, skip building or to define a global .mbt_skip_modules at the repo root with a list of modules not to build.If any modules that depended on a skipped module, it should either skip or fail gracefully, optimally it should be configurable I guess.
What do you think?
The text was updated successfully, but these errors were encountered: