-
Notifications
You must be signed in to change notification settings - Fork 289
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
Modifies the behavior of the tag_filter
#165
Conversation
…t tags from all branches will be searched. This is accomplished through disabling the `--single-branch` git flag from the `check` and `in` assets whenever the `branch` configuration flag is set by the user. Two tests were added to `check.sh`. One is responsible for making sure all tags on all branches are available to the filter (`it_can_check_with_tag_filter_for_all_branches`). One is responsible to make sure tags are ignored from other branches when a branch is specified (`it_can_check_with_tag_filter_for_all_branches`). Additionally: * Small modifications to `helpers.sh` to facilitate new tests. * A git flag, `--merged`, was added to the `check` asset any time the `--single-branch` flag is present. This is because all tags are present on all branches for locally cloned git repos (like this present in the tests). * the `$tag_filter` if statement in the `check` resource was modified by replacing repeating commands with a environment variable. This was done to reduce errors.
@vito so it looks like this isn't going to work either. It all seems to be related to:
(lines If I remove this and simply have:
It works (although test In the README it states:
My assumption is that the troubles i'm facing are related to the "pulled if already present" part. Any ideas? |
… single-branch flag check
Seems more likely to be due to the This assumes that a given tag N will have all tags N-1, N-2, etc. prior to it in the commit history, and that tags aren't dangling on their own |
@vito I think this is what is causing the failure. When the git repo is pulled without a branch, it is So, for example, if I have a repo with tags:
when Any ideas? Also, I will admit that it is very possible I am wrong. |
I'd be surprised if that's how it behaves; tags point directly to trees and exist across all branches. If |
I'm not sure if that is completely accurate. For example, if you look at the Basically, it appears that tags are actually attached to specific commits, and if that commit does not exist in the history of the branch, it will not exist in the list when running So, it would follow (I think...), if |
@sabjorn Well, if the tags are on completely different branches not sharing a given common ref, that'd explain it too - not because the tag listing is scoped to a branch, but because the ancestry isn't shared, right? (i.e. the other tags cannot Currently |
In the context of this global For more context: the reason I need this change is that my team uses new branches for releases, so changing the CI for each release would be necessary. However, I have different tag filters for the different types of triggers (e.g. I've been running a modified version of this PR (with the |
@sabjorn True! I'd be fine with removing So, if versions I think in the case of |
@vito finally got back to working on this a bit.
Unless i'm reading this incorrectly, this means If At this point, i'm thinking that probably the best idea is to modify:
So that it makes sure it is also on a branch to run the
This way, if we're on a branch, However, maybe i'm getting something wrong. If the |
Now, if
branch
is not set tags from all branches will be searched.This is accomplished through disabling the
--single-branch
git flag from thecheck
andin
assets whenever thebranch
configuration flag is set by the user.Two tests were added to
check.sh
. One is responsible for making sure all tags on all branches are available to the filter (it_can_check_with_tag_filter_for_all_branches
). One is responsible to make sure tags are ignored from other branches when a branch is specified (it_can_check_with_tag_filter_for_all_branches
).Additionally:
helpers.sh
to facilitate new tests.--merged
, was added to thecheck
asset any time the--single-branch
flag is present. This is because all tags are present on all branches for locally cloned git repos (like this present in the tests).$tag_filter
if statement in thecheck
resource was modified by replacing repeating commands with a environment variable. This was done to reduce errors.