How to find the pulled date of an image in Harbor with skopeo inspect? - harbor

How to get the docker image when has been pulled with skopeo inspect?
When I use skopeo inspect --tls-verify=false docker://${image_path}:${tag} --config
I can only find the key value "created" without "pulled".
If skopeo is not OK, curl should be OK.

The pulled date is not part of the spec. The pull date is only in Harbor and skopeo is only spec compliant. Using curl, harbor-cli or api client will do it.

Related

Updating Bitbucket pull request's description through Bitbucket API

The scenario which I'm looking at is at the process of CI - There exists a test (implemented with python script) which checks if the PR's description is in a certain format. And if it is not, the PR is denied (fail).
Instead of failing, I would like to have an update for the description in order for it to pass with default values in it.
So the main question is if there exists a way to add/update Bitbucket pull request's description through Bitbucket API? (Preferably a way for implementing in the python script of the test itself).
Edit: I found an API for getting the description, but i need to find one for updating.

Create issue : Test link integration with jira

I've integrated Testlink with Jira using below xml
<issuetracker>
<username>xyz</username>
<password>#123</password>
<uribase>abc.net/projects/KEY/</uribase>
<uriapi>abc.net/rest/api/latest/</uriapi>
<uriview>abc.net/browse/</uriview>
<projectkey>KEY</projectkey>
<issuetype>1</issuetype>
</issuetracker>
I am able to link existing jira issue in to test link.
But create issue window contains Version field which would not alow me to enter any value or not giving any suggestion as displayed in below image.
I've tried to create version in jira but it doesn't work.
So,
What value i should enter/configure for version field ?
What is use of <issuetype>1</issuetype> ? can we provide any other value?
How to link new field on create Issue window?
4.Version is mismatched with jira field Versions.
I'm not sure which version of JIRA REST API you are using but the tutorial for the v2 says:
Just like everyone else in the real world, we're faced with time and resource constraints. Supporting two serialisation formats requires more time than just a single one. Hence, for our initial release of the JIRA REST API, we decided to provide "more stuff in JSON" rather than "less stuff in JSON and XML".
So I'm not sure about the XML support. I have no experience with Testlink, but I guess it's using some kind of serialiser at the back end.
If you check the Create issue endpoint, there is no version field. I guess it will be the versions field instead. In JIRA projects can have multiple versions. You can get a list of versions from the Get project eversions endpoint.
Issue type is an ID of issue type you want to use for your issue. You can get a list of project specific issue types from the Get issue all types
endpoint.
I'm not sure about this
Check the first point
This version field is empty because you have not specified any version for your project in JIRA. In my case it was Fix version in JIRA. Currently the rest API is getting an empty list of versions. You can try
curl -X GET http://example.com/rest/api/2/project/KEY/versions
-H 'authorization: Basic dtgzkisVlbyhsuYWhtYijdsdidjjsidDkw'
This will give you an empty list.
Once you set FixVersion in for your project in JIRA, this API will return the list of available versions for your project and the Version field will be populated with those versions.
PS: use your own authorization headers. You can use [Postman][1] for this purpose.

Getting file diff with Github API

net project for which I need to detect and parse changes made to a specific single text file in a repository between different pull requests.
I've been successfully able to access the pull requests and the commits using the Github API but I don't know how to retrieve the lines that changed in the last commit?
Is this possible using the API? What would be the best approach?
If not should I try to read the last two file versions and implement a differ algorithm locally?
Thanks!
A pull request contains a diff_url entry like
"diff_url": "https://github.com/octocat/Hello-World/pull/1347.diff"
You can do this for any commit. For example, to get the diff of commit 7fd1a60b01f91b3 on octocat's Hello-World it's https://github.com/octocat/Hello-World/commit/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d.diff.
This also works for branches. Here's master on octocat's Hello-World. https://github.com/octocat/Hello-World/commit/master.diff.
The general form is:
https://github.com/<owner>/<repo>/commit/<commit>.diff
For private repositories:
curl -H "Accept: application/vnd.github.v3.diff" https://<personal access token>:x-oauth-basic#api.github.com/repos/<org>/<repo>/pulls/<pull request>
Also works with the normal cURL -u parameter.
See: https://docs.github.com/en/rest/reference/pulls#get-a-pull-request
The crux is in the requested media type. You can pass the Accept header with value
application/vnd.github.diff
see documentation. For full reference, a GET request with the above and Authorization header to https://api.github.com/repos/{orgName}/{repoName}/pulls/{prId} does the trick.

Is it possible to get commits history for one file in gitlab api?

I want to get the commits or the last commit for one file in gitlab api like this:
GET /projects/:id/repository/commits?path=fileName
Gitlab support or not?
There is a patch that implements this feature:
https://gitlab.com/gitlab-org/gitlab-ce/issues/18898
Unfortunately, it has not been merged yet:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4814
Edit: now merged, expected to land in 8.14.0 (2016-11-22): https://gitlab.com/gitlab-org/gitlab-ce/commit/146d4348ca6812e26729de40a831f4ae8c27fde6
Now you can do:
/projects/:id/repository/commits?path=:file_path
and receive array of commits about specific file.
Link to documentation
Unfortunately not. With GitLab 7.14 you can only get all commits of a repository with the following command:
GET /projects/:id/repository/commits

Unable to add tags to workspace via Asana API

I am using the following command to add tags via the Asana API.
curl -u '<api_key>' https://app.asana.com/api/1.0/tags -d "name=testing" -d "workspace=15601112094251"
I even get a successful JSON reply with the created tag object. However, I never actually see the tag inside Asana. I also do not see the tag when listing all tags for my workspace.
When I query for the tags specifically by ID, I do see it though.
Bug on Asana's side? Or am I doing something wrong?
See https://stackoverflow.com/a/24873988/254896 - because of the way the data model works, tags that aren't assigned to anything are hidden.