History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2114
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Robin Shen
Reporter: Andrel Vahter
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

QuickBuild configuration is not tracking repository (GIT) changes if wildcard branch is used

Created: 09/Jul/14 07:18 AM   Updated: 11/Jul/14 11:09 PM
Component/s: None
Affects Version/s: 5.1.12
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Not related to environment. Reproducible in our Dev/Test/Live machines


 Description  « Hide
We have a configuration, that should track and trigger build if changes are made in different branches of a GIT repo.
So we have set up a configuration with a Git repo.
Branch Name = ${vars.get("gitBranch")}
Variable - gitBranch = TEST-*
Scheduled every 5 min.
Build Condition = If changes found in referenced repositories

The configuration is sadly never triggered.

If the gitBranch variable is not set as a wildcard parameter (example TEST-1)
The Build is triggered as expected.


There is currently a workaround with groovy script we use. But this could work out of the box with "If changes found in referenced repositories"

Workaround itself is:

Build Condition: If specified script evaluates to true.

groovy:

for (repository in configuration.getReferencedRepositories()) {
if (repository instanceof com.pmease.quickbuild.dependency.QuickbuildRepository) {
continue;
}
if (repository.name=="reponame" && repository.isChanged())
{
return true;
}
}
return false;


All the best and hope to hear from you,
Andrel


 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [10/Jul/14 01:54 AM]
I am able to get this working with a simple repository as described below:
1. define a simple repo as below:
git init /path/to/repo
git add file
git commit -m "initial"
git checkout -b branch1
git checkout -b branch2
2. define a git repository with pull url set to "/path/torepo", and branch set to "branch*", and set the schedule to trigger every 1 minute, with build condition set to "if changes found in referenced repositories".
3. define a checkout step to checkout above repository.
4. now wait for a minute the two builds will be generated in the configuration, one of branch1 and another for branch2
5. make new commits in /path/to/repo for branch1 and branch2
6. wait for a minute, and another two builds will be fired automatically for branch1 and branch2

So the reason it does not work at your side might be due to a mis-configuration. Can you please test above simple case against your repo to see if it works?

Andrel Vahter [11/Jul/14 06:45 AM]
Hi,
Strange thing is, that using the exact same configuration
I first tested the "if changes found in referenced repositories". Option and it did not work for me.
Then i created the groovy workaround. It worked.
Now ofter you feedback that you where unable to reproduce it I changed it back to "if changes found in referenced repositories" and now it works.

I'm even more confused then before, but you can close the issue.

Ty for you time,

Andrel

Robin Shen [11/Jul/14 11:09 PM]
Closing it. Feel free to reopen if you find the issue again.