Open pawepaw opened 8 years ago
Any info?
Is your branch name of the pull request prefixed by feature/
? The only time we had this issue is when we didn't write the correct branch specification
Yes my branch is prefixed by feature.
In teamcity it says it's building correct branch but i spotted this by removing test on the branch. Even after removing, it was running. Checked sources in work directory and it was wrong branch.
Hmm, I'm having a hard time figuring what could be wrong. If TeamCity is building the correct branch, then the trigger works as expected, otherwise you would see a build of develop
being started. Maybe you can try checking the "Clean all files in the checkout directory before the build" option.
If i trigger build manually using run button and i chose which branch it all works fine. Gonna check what will happen if i set clean all files..
Checked if "Clean all files in the checkout directory before the build" and it does not help.
btw. I've checked logs and teamcity implicitly change branch to develop. I can give you more data to reproduce it if you need.
I will sum up everything here:
develop
apporve on success: true
develop
branch specification:
+:refs/heads/feature/* -:<default>
clean policy:
on branch change
clean files policy:
all untracked files
I've created new branch based on develop with name feature/CMP-4290/check-pr-branch-source
and created two tests that are failing always.
[Test]
[Category("Unit")]
public void TestPrBuildConfiguration()
{
throw new NotImplementedException();
}
Here is build result if it's triggered by plugin (after creating pull request with this branch):
Here is build result if i triggered it manually selecting changes:
On each trigger branch contained the same changes so in both triggers it should fail on two tests. But in build triggered by plugin it does not fail because as you can see in logs it collects changes from develop branch.
Thanks for the detailed report. I spotted 3 differences with how we use it :
-:<default>
in branch specificationCould you try server side checkout?
Regarding versions, we're running the plugin on TeamCity 8.0.1, TeamCity 9.0.1, TeamCity 9.1 and TeamCity 9.1.6
Tried all except removing "apporve on success". I'll try to apply all of above.
edit. Tried, makes no difference. Still builds develop.
Teamcity 9.0.4 - works with feature branch with settings as @meriouma suggested above.
any info? Maybe you have any idea what else i can investigate? Tried changing my branch specification from +:refs/heads/feature/*
to +:refs/heads/Feature/*
but it makes no difference.
I'm running out of ideas. Can you try watching +:refs/heads/*
and create a branch without /feature
to see if it changes anything?
Yeah, thanks! Started working after changing to +:refs/heads/*
it works now for every pull request to develop but it's ok.
Hello,
I'm using teamcity 9.1.4 and I wanted to build my feature branches (all are based on develop branch). I made configuration for VCS root and configured branch specification there:
develop
Branch specification:
+:refs/heads/feature/*
base branch:
develop
Teamcity detects pull requests but it builds with sources from develop branch not from feature branches. Is it possible that teamcity api has changed and triggering build for specific branch no longer works? Or i missconfigured something?
Edit: I've changed default branch in vcs root to another branch and it started building this branch. So no matter what my branch specification is it always builds default branch from vcs root.