We have TFS 2018 Update 3. We have git repositories and branches on them are secured with branch policies.
We have TFS groups which are through branch policies used as default approve groups for pull requests.
Problem: when somebody creates a PR to a particular branch, we'd expect, that people in the default group receive an email from TFS that new PR was created.
Despite the fact, that all of them have their own notifications enabled, they do not receive it...
Is there any configuration I need to do?
You need to configure the notification in the Team level:
Related
How does an admin configure Gerrit to automatically reject commits without JiRA ticket number? I've read this documentation but not sure how to implement it on all branches in a specific repository (not all repos!). Do all users need to download the file and copy it to their local repository or how does it work? What I want to achieve is that git/gerrit automatically rejects a commit that are missing a JiRA ticket number - doesn't have to be valid, it's up to the team to control that the ticket number is valid.
The Jira plugin is based in the ITS plugin. These plugins have a association configuration that can be set to MANDATORY.
MANDATORY : One or more issue-ids are required in the git commit message, otherwise the git push will be rejected.
SUGGESTED : Whenever git commit message does not contain one or more issue-ids, a warning message is displayed as a suggestion on the client.
OPTIONAL : Issues-ids are liked when found on git commit message, no warning are displayed otherwise.
The below config example is taken from the Jira plugin documentation.
[commentLink "Jira"]
match = (\\[[A-Z][A-Z]+-[1-9][0-9]*\\])
html = "$1"
association = MANDATORY
The Git::Hooks is the best solution to this job.
See how to install and configure it here.
See more info about it here.
We plan to have only admins able to make changes to our repo’s master branch. Developers can clone the repo and then create their own dev branch off of master to work on. When developers feel ready, they can merge their development branch onto the master branch using a pull request. However, they will not be able to merge their dev branch into master until the admins have approved the changes.
On Bitbucket, I set branch permissions as:
+ Write Access: Rachel and Jamie.
+ Merge via pull request: Rachel, Jamie, and team:developers.
+ Merge checks: check for at least 2 approvals.
Next, we had a developer (not Rachel or Jamie) make changes on their own dev branch. They then committed and pushed the changes to their remote dev branch--worked as expected.
Last, they initiated a pull request to merge the remote dev branch into master. A warning that two approvals was needed popped up, but the developer was still able to just click "Merge" and the dev branch merged into the master branch, despite 0 approvals.
I expected that the developer would not be able to merge with 0 approvals. How do I set permissions so that this is the case?
Two things:
You explicitly granted "merge via pull request" access to the developers. They're therefore able to merge pull requests. If you never want them to merge PRs to that branch, then revoke that. (They'll still be able to create PRs, just not merge them.)
You didn't mention whether you've enabled "Prevent a merge with unresolved merge checks", under the premium features.
We've created a plugin to prevent this situation. You can inspect it on marketplace:
https://marketplace.atlassian.com/apps/1219882/prevent-merge-when-needs-work
I already merged a pull request in bitbucket. Can you all explain what is the difference between click Approve and don't click it?
Because I see that the merge commit still appears in git history/log even that I don't click Approve.
If your team has a Premium plan, repository admins can prevent pull requests that don't have a certain number of approvals from merging.
Other than that, it is a visual check only that the merge request was reviewed and approved prior to merging.
See: https://confluence.atlassian.com/bitbucket/pull-requests-and-code-review-223220593.html
I would like to know if it is possible to send an e-mail notification to certain users when there is a modification to a particular directory within a repository in Stash. I know it is possible to write a shell script within Jenkins project to do this and then inform through e-mail but I would like to know if there is a native option within Jenkins configuration to this action.
This is possible within BitBucket Server itself as of May 7, 2013:
Repository subscriptions
[...] At times, you may want to receive emails on specific types of messages you care most about including:
...
Commits – when a new commit is added or a comment is left
...
See also Manage Inbox and email notifications.
You can use Poll SCM under Build Triggers section.
Define a job that uses GIT plugin, specify a workspace and machine so it'll always be synced with the latest, and poll every 2 minutes. if there is a change in the repository the job will be triggered. Add a post build action to send emails using the built in email notification or using Email-ext plugin.
Don't forget to edit the SMTP information under Manage Jenkins->Configure.
You can check Here for more information about Jenkins Polling.
We have TFS 2012 installed.
I want to enforce check-in policies (Code Reviewer name, Work Item association and Comments) for each check-in.
All these settings are performed and are working fine. But still users have option to override the settings and check-in.
I want to setup email alerts so that whenever user check-ins without filling all check-in policies, there must a mail sent to user.
I tried Event subscription Tool and TFS mail alert options but both of them work for current user.
We have more than 200 employees and I cant ask each of them to subscribe for mails.
Is it possible to write custom code or some tool available which will be triggered when user check-ins overriding policies and send a mail to user?
You can create a TeamAlert for CheckIn events where Policy Override Comment is not empty and Commiter = [Me]. This will sent a mail to the developer that checked in overriding the policies.
Another option is to write an EventHandler plugin for TFS, which completely denies checkins that try to override the policies.
Finally I found solution. TFS Plugin Suite This plugin is really awesome. Once the plugin is in-place, it will be called before check-in and will validate the required fields and block check-in unless all values are correct.