How do I discard a draft review comment on gerrit using API? - gerrit

How can I discard a draft comment from a specific gerrit review using API, either HTTP (REST) or ssh one.
Note: I am not looking for a "click the web interface" solution.

Use the following endpoint to list the drafts comments of a revision:
GET /changes/{change-id}/revisions/{revision-id}/drafts/
See more info in Gerrit documentation here.
And then use the following endpoint to delete a draft comment:
DELETE /changes/{change-id}/revisions/{revision-id}/drafts/{draft-id}
See more info in Gerrit documentation here.

Related

is there a way to add token info to the solana devnet like on the mainnet?

I want to test our token incl. naming, icon, price etc. on the Solana Devnet but was only able to find the token-list PR which is currently only available for the Solana mainnet (as far as I can tell)
Can someone tell me if there's a "token-list pull request" on the devnet or an alternative way to handle that, pls.?
To add a new token for devnet only, you can put in a normal token addition pull request, but you'll have to specify "chainId": 103 for devnet. This is defined at [1], and you can see all of the current devnet tokens at [2].
[1] https://github.com/solana-labs/token-list/blob/c1ff0ac267d03397f56a7030b02d357f90d49f79/src/lib/tokenlist.ts#L5
[2] https://github.com/solana-labs/token-list/blob/c1ff0ac267d03397f56a7030b02d357f90d49f79/src/tokens/solana.tokenlist.json#L7513
As Jon pointed out, you need to make a PR to solana-labs/token-list.
However, the repository has been archived, so this method no longer work.
In the README you will find latest instructions to update the token metadata.
You can also use this tool https://token-creator-lac.vercel.app/ to update your token metadata on devnet.
Here is a screenshot of my Phantom wallet after updating token metadata:

Pull Request Permission

I have question on ADS GIT Pull request permissions Is there any way to prevent others from being able to change the status your pull request? like being able to publish your draft request, setting the complete status, abandoning etc?
Is there any way to prevent others from being able to change the status your pull request?
Sorry for any inconvenience.
Now, Azure devops service/server doesn't provide a feature to meet this requirement.
To protect the Pull Request, you could add reviewers for the target branch to prevent set the complete status directly.
On the other hand, we could set creator's target branch or repo contribute permission to Deny, you need to add specific user to target Branch security page. This not applied to all the creators all the PRs. Just a specific PR and specific user:
But none of these settings apply to abandon. For this option, you could add your request for this feature on our UserVoice site (https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ), which is our main forum for product suggestions. Thank you for helping us build a better Azure DevOps.
Hope this helps.

patch request to microsoft graph api for planner task does not return the updated task in the response

According to the documentation on updating order hints in planner.
The client can obtain the values immediate if return=representation preference is specified in the PATCH requests.
I've tried putting this in the header, and as a query parameter, but I still only get back a 204 response.
Where in the PATCH request, does the return=representation go ?
Just as you can see in the docs:
Important: APIs under the /beta version in Microsoft Graph are in
preview and are subject to change. Use of these APIs in production
applications is not supported.
The API is still in development. So the documentation may update too.
You can submit an issue to the Github issue list first. Meanwhile vote up the existing request or submit a new one in the UserVoice
The graph sdk team enlightened me.
The header Prefer:return=representation is what needs to be set.

Upsource Webhooks and JIRA

I am working on automating the code review process in my team.
My objectives are:
When a review is created, assign it to two random developers
Automatically update the JIRA item, and assign them to the developers who were assigned as reviewers in Upsource
I was able to achieve objective #1 using Upsource Custom Workflows.
For the second objective, I have tried looking at Upsource Webhooks and JIRA Cloud REST API, but I fail to see how to assign a JIRA item from Upsource. JIRA's API specifies that in order to assign an item using REST, we need to create PUT request to this method:
PUT /rest/api/2/issue/{issueIdOrKey}/assignee
How can I create a PUT request from Upsource Webhooks?
How can I extract the {issueIDOrKey} from the originating Upsource review?
How can I create a PUT request from Upsource Webhooks?
Upsource webhooks send only POST requests at the moment. But I don't see how this limitation is blocking your task, because as I understand there has to be a service that'll translate Upsource payload to JIRA payload. That service should make a PUT request.
How can I extract the {issueIDOrKey} from the originating Upsource review?
Upsource provides an API for this. getReviewDetails method allows to get a list of issues associated with a given review (see this message spec).

Dashboard using output results from Jenkins API

I am new to Jenkins API. I just had assignement in company where PL asked me to create a new job in Jenkins where I will run all the testing,build related things on my code and it should create dashboard where all figures and graph should be shown. He said that its feasible. Can anyone please guide me to do so.
Checkout Sectioned-Vew-Plugin.
Create a Job on Jenkins and add /api after the Url. You could see the API Information related to the Job you have just created. The API will contain the Get End points for Retrieving the data. Its available in JSON as well as XMl which you can parse and use as the source of Info for your dashboard. You can also trigger a new Build by using the Post API.

Resources