Customization of GitLab notification emails - gitlab

I am having a hard time finding a definitive answer on the internet. Is there a way to customize GitLab notification emails? For example, when a pipeline has passed, I want to give more precise information than the ones provided by the default sent email.
If it's not yet implemented, from where comes the email parameters (e.g., branch, commit)? I don't understand how they work.
Thanks!

Related

Gitlab CE - approvals workaround

Hey I have Gitlab CE version and I would like to implement a job that verifies approvals from a peer. I know this feature is totally available for premium and ultimate versions. However, I already created a little hack that verifies that the person who approves the MR is different from the one who created it.
My question is: is there a way to cancel the approval, without being manually, if there has been a change to the code?
is there a way to cancel the approval, without being manually, if there has been a change to the code?
This is already the default behavior in GitLab. When new commits are pushed the source branch of an MR, all approvals are removed.
However, if that setting is not available in GitLab Free, there is no workaround for this as only the approver can revoke their own approval. You might be able to make a pipeline job remove the approval using the API, if you have a personal access token for every approver available in the job, but this is quite impractical.

Azure DevOps - User triggering release as approver

We have a CI/CD setup in Azure DevOps that gets triggered from push on master branch. Is it possible to make the approver the user that was the cause of the build trigger?
The idea behind this is that we have many developers in our team so I want the specific dev that pushed changes make the decision on whether or not they want the changes deployed, vs. a dedicated approver.
Short answer, no.
Context:
This is the opposite of a good practice, which is why there's an option to require someone else to be the approver, but not the person who made the change. You don't want the person who made a change to be the one to approve it, because that enables a single person to sneak a change through. This means that mistakes can slip through, or even intentionally malicious changes.
The best practice is to require someone other than the person who made a change to review and approve the change.
While I totally agree with #Daniel Mann on why this shouldn't be done, the way I've seen it happen is that the Team is assigned as the recipient of the approval request, and the user requesting a release or deployment should not approve it checkbox remains unchecked.
Then to avoid the inbox noise of the approval request, turn off the notification for the team about pending release approvals.
EDIT
If you must have only that one person assigned as the valid user to approve changes for deployment, you could do this too, but it wouldn't be pretty. You could have a "stage" per person. These stages would use artifact filters in the pre-deploy conditions to only send approval email to the person that stage is for.
After the approval it forwards to the actual deployment stage to do the work.
Now you need to add the username or something as the tag on the build. I'm unsure if there's a tool/task to do this as part of the build pipeline to keep it continuous, but I know you could figure out how to do it from the REST api. Perhaps you would need to create a pre-approval stage that runs a PS script to access the REST api and tag the provided build with the value of requestedBy property on the build.
Again, see how hard it is to do this? That probably means you're not following best practices. "Make the right things easy and the wrong things hard." -Unknown

Gitlab code review batch comments?

Is it possible to get batch comments in Gitlab when doing a code review? Similar to Phabricator, where you only get one email when the reviewer makes multiple comments on your code?
We are trying to use Gitlab at work, and feel kind of spammed by the individual emails per comment.
Thanks
This is now available as per this news
There is an open feature proposal for this here.

using mail server to communicate with jira using api

im new to jira and its mail handlers.i want to use the jira's mail handlers to scan two folders in my mail box.and update two projects related to those folders. and i did that.
but now i want to extend that functionality.i want to keep the mails in those folders (stop mail handlers from deleting it after processing) and make it able to move issues/tasks across projects simply by moving the associated mail from the folder to the other folder. resulting in deletion of the original issue/task from that project and creating it in the other folder. please help in making this a possibility.
for those who didnt understand my problem: imagine im sending a cv for the post of php developer to a mail. when the reciepent checks it, he puts it in the php folder in his mailbox.so then a task is created in the project php developers. but next the reciepents thinks im more suitable in web developement rather than in php. so he just moves the mail from php folder to the web folder.so the existing task in php project gets deleted and a new task is created under web developement project. can i do this? if so how? please guide me..
Update
sigh..
i dont know how to work with corporate people. now the situation has changed. i hope you could help me with this one.sorry about the sudden change in the question..again...
now my boss wants sth like this.
i created a mail client using imap function to access mail services and retrieve those mails to a web function. theres no problem in that. but now my boss wants to handle jira through that same app aswell. means as like the my question when moving, putting a mail to a folder the app it self should comunicate with jira and make the necesary issue creation and deletion.. is this possible #Kuf?? if so please help. because my deadline is due Wednesday. and im almost there to panic..lol..please forgive me for changing questions like this. as it is not my will..
edit
I have seen that rest api does this. but how to use it? any answers?
The simplest way I found was to receive the emails in your main account and forward them to a second account, while saving a copy on the mail server. Than, tell Jira to pull the emails from the second email.
UPDATE
In the past, I've looked for a way to change Jira's email handler functionality, as you can see in this question here. It is impossible to achieve what you're asking using Jira's email handler because the way it works, it does not keep records of which emails were already read, Jira's service checks for new emails, ignores emails according the pre-defined filters (spam or user defined), handles the rest of the emails, and deletes them so it won't process them again.
The way I can think of to get the functionality you want is to re-write the email handler, you can get the source code, re-write it, and build it into your Jira app.
Another way, which i find easier, is to get all the emails into Jira, and from within Jira move the issues from one project to another. You can even create pre-defined buttons using Jira Scripting Suite to easily move issues between projects (create a post function and attach it to workflow transition).
If you need any help let me know. Good luck!
EDIT 2
Which Jira version do you use? which actions are you planning to do using the remote API? Jira REST API is the newest, but some of the old APIs have capabilities that are lacking in REST. To try and decide which API suits you, have a a look at JIRA Remote API Reference.
If you decide to use the REST API, I suggest that you read Jira's Getting Started with REST manual, which shows how to use the REST API. For the full documentation check out JIRA REST API documentation (make sure to use the right version according to your Jira version).

SharePoint - set reply-to in a workflow

I have my SharePoint server set to send e-mails from a dedicated e-mail box. However, I have a workflow that sends an e-mail out to a particular group, and I want replies from that group to go instead to a different e-mail box.
I know that BCC is a hidden field in a workflow that can be changed; I don't see anything for reply-to. So I'm not sure that there's an easy way to do it. What options do I have? I know there's a tool on CodePlex that does a lot with e-mail activities, but I think that might be overkill.
I appreciate any suggestions, advice, etc. Thanks very much!
Basically, you can't specify a reply-to email address using SharePoint Designer out of the box. Since it is a workflow, you can create a Custom Workflow action that would allow you to do anything you want (including send an email with a reply-to address). This is a pretty involved process and will require C# code.

Resources