Skip to content

Runs actions, if configured, in branch plans as well as master plans#10

Closed
alindeman wants to merge 1 commit intoHackAttack:masterfrom
alindeman:status-for-branch-plans
Closed

Runs actions, if configured, in branch plans as well as master plans#10
alindeman wants to merge 1 commit intoHackAttack:masterfrom
alindeman:status-for-branch-plans

Conversation

@alindeman
Copy link
Copy Markdown
Contributor

As part of these changes, I switched to using CachedPlanManager, which is recommended for performance if only immutable versions of plans are required.

Feedback welcomed!

@HackAttack
Copy link
Copy Markdown
Owner

I don't understand the intent here…the plugin already works on branch builds (in fact that's its main use case). Can you elaborate?

@alindeman
Copy link
Copy Markdown
Contributor Author

It doesn't seem to be sending statuses for branch plans for me. This is supposed to work out of the box?

@HackAttack
Copy link
Copy Markdown
Owner

Yes. You have plan branches enabled?

@alindeman
Copy link
Copy Markdown
Contributor Author

Yah, I did a bit more research and determined the bug only occurs if the configuration for bamboo-github-status is saved. Here's my full log of how to reproduce it on a clean Bamboo instance (atlas-debug):

Created a linked repository "test" pointing at https://github.com/alindeman/test with a default branch of master:
screen shot 2015-11-23 at 9 17 46 pm

Set the "test" repository as the default repository for a build plan:
screen shot 2015-11-23 at 9 19 08 pm

Enabled the repository for sending statuses:
screen shot 2015-11-23 at 9 19 45 pm

Ran the plan on master. The status is sent successfully:

[INFO] [talledLocalContainer] 2015-11-23 21:20:12,565 INFO [AtlassianEvent::0-BAM::EVENTS:pool-3-thread-6] [AbstractGitHubStatusAction] GitHub status for commit 246943aa430ffb02cb7e35c06c7c30e637c6eb7a (Build) set to SUCCESS.

Created a branch plan for the patch1 branch:
screen shot 2015-11-23 at 9 21 49 pm

No status is sent 😢

Note that the master branch plan key is AP-SUCCEED; the branch plan key is AP-SUCCEED0 (Bamboo creates this automatically).

When I debug the run of the branch build (AP-SUCCEED0), the RepositoryDefinition of the main repository in the branch plan is not the same as the RepositoryDefinition from the main plan. It's not the same RepositoryDefinition: it's a different branch, therefore a different RepositoryDefinition ID:

abstractgithubstatusaction_java_-_bamboo-github-status_-____src_github_com_hackattack_bamboo-github-status_

Does this make sense? It appears that when a branch plan is created, a new RepositoryDefinition is created. It'll have a different ID than the RepositoryDefinition on the master plan.

If I do all these steps, but skip the part about navigating to the Miscellaneous tab, checking the test repository, and saving the configuration, statuses for the branches are sent successfully. In that case, configuredRepos will be null and the default ("all GitHubRepository instances") will be used. Again, however, if the Miscellaneous tab is visited and the configuration saved, the list of RepositoryDefinition IDs will only match on the master plan, but not on any branch plans.

@HackAttack HackAttack added this to the 1.3 milestone Nov 29, 2015
@HackAttack
Copy link
Copy Markdown
Owner

Thanks a lot for this detailed report! I've never been confident about how the configuration works. Will have to look into this.

@HackAttack HackAttack closed this in c0664b6 Dec 4, 2015
@HackAttack HackAttack added the bug label Dec 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants