How to get Gerrit detail from change-id existing in different projects? - api

I would like to get change detail from change_id assume 123
Using GERRIT API:
https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-change-detail
But In such a case it throws error:
HTTP Error 404: Not Found
!! CODE=404 !! None -> b'Multiple changes found for 123\n' # http://<GERRIT_SERVER>/a/changes/123/detail
The problem is that there are changes with same change_id in multiple projects.
Same command works properly when I try to get detail for change_id which exists only in single project.
Do you know some workaround for such a case?

Add the project to the search.
See the Gerrit documentation here.
{change-id}
Identifier that uniquely identifies one change. It contains the URL-encoded project name as well as the change number: "'~'"
Gerrit also supports the following identifiers:
an ID of the change in the format "'~~'",
where for the branch the refs/heads/ prefix can be omitted
("myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940")
a Change-Id if it uniquely identifies one change
("I8473b95934b5732ac55d26311a706c9c2bde9940")
a numeric change ID ("4247")

Related

How to find an issue with name of the fixed_version_id instead of the id ? (redmine)

I would like to find an issue in Redmine with some criteria (ex: name of the fixed_version_id, project_id, ...) but I still not able to find the syntax.
The issue I would like to find has :
a custom field = 113
an application like BAC
a project_id = 997
a fixed_version_id's name = 221200
I tried this :
https://redmine.xxx.com/issues.xml?cf_113=BAC&project_id=997&status_id=*&fixed_version_id[name]=221200
But it does not work. Could you tell me if it's possible please ?
Thanks
H.
I try to find a way to get an issue based on the name of the fixed_version_id instead of its id
With the issue query, you have to provide a version ID. The issue filters can not filter based on other attribites of the version.
You can however use the API to get a list of versions in the project:
https://redmnine.xxx.com/projects/997/versions.xml
Using this list, you can find the ID of your desired version and use this ID in the second request to get the issues for the version.
The APIs are documented on the Redmine wiki at
https://www.redmine.org/projects/redmine/wiki/Rest_Issues
https://www.redmine.org/projects/redmine/wiki/Rest_Versions

Wrong "ReflectedWorkItemIDFieldName" while migrating Azure DevOps Work Items

I am testing the azure-devops-migration-tools and have create a project using https://azuredevopsdemogenerator.azurewebsites.net/ (Parts Unlimited). I have generated the configuration.json and changed the Source and Target so I can test a migration, but I'm getting errors while migrating Work Items.
[15:14:41 ERR] Error running query
Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «ReflectedWorkItemId».
I've tried different options on the "ReflectedWorkItemIDFieldName" field, Scrum, Basic, Agile, Custom, empty but am still unable to migrate the work items.
How can I get the value to put on this field for the specific project?
Thanks,
Bruno
Quick Solution: Most ADO instances use the prefix 'custom' for new fields. Try "Custom.ReflectedWorkItemId" in your configuration.json to see if that resolves the problem.
More details: It's hard to tell without an actual configuration.JSON file to review. One possible problem is that you need to use the actual and full internal 'Name' of the ReflectedWorkItemID field. This doesn't show in ADO, or the Process Template when created. The recommendation is that you create a query referencing your custom field, and export the WIQL file (query file). Once you export the WIQL file, you can then open the file and see the full syntax of the custom field.
Exporting Queries: If you don't know how to do this, it can be done with VisualStudio. If you don't know how to do that, you can install this extension. It's a handy WIQL import/Export and editor. Install, and your ADO Queries with have an Edit in WIQL Editor option. Create a query that exposes your 'ReflectedWorkItemID' as a column, then edit that query in the WIQL editor and see the full names of the Reflected Work Items ID Feild. https://marketplace.visualstudio.com/items?itemName=ottostreifel.wiql-editor
SELECT
[System.Id],
[System.WorkItemType],
[System.Title],
[System.AssignedTo],
[System.ChangedBy],
[Custom.ReflectedWorkItemId]
FROM workitems
WHERE ...
I found a possible solution. I have created a custom process, change the process from the projects to this new one and add a new field. This is the field I'm using on the configuration.json and now I'm able to migrate work items
To make the migration in the "ReflectedWorkItemIDFieldName" you must do:
"Organization Settings" -> Process -> Select the process where you project are (Basic, Scrum, Agil, or CMMI).
then click on the 3 dots and create a new Inherited process.
Then with the inherited process, you are able to create a new field for each work item type. The name that you type (could be "IronMan") that name will be in your configuration file.

What does '-' mean in the job's URL?

What does the symbol '-' mean in the job's URL https://mygitlab.com/mynamespace/myproject/-/jobs/827991 (Gitlab CI)? Is it normal, "valid" URL? I plan to store it in a database and to use it as an URI to the job, so will I have any problems with this URL? How "stable" is it? Is it possible that something is missing (some project property/attribute), so there is this '-' but if somebody will add this attribute to the project then the URL will be changed?
Consider the following, you or your company have decided to do a major rebranding, and part of this migration is abandoning old domain name for a new one. With that in mind you can see that you'll have to update all of the records with a new domain name. Same is true if you want to migrate your project to a different namespace, or just rename a project. There are stable and unique fields though:
project id
job id
Using these fields you can always construct a valid url, no matter what happened to human-readable parts of that url.
Look at jobs api: https://docs.gitlab.com/ee/api/jobs.html#get-a-single-job
You can get an url you mentioned earlier from "web_url" attribute of response
"web_url": "https://example.com/foo/bar/-/jobs/8"
By storing only 2 integers and global gitlab url you will always get a proper "human-readable" url no matter what.

How to get old value in OpenDJ server?

I've already enabled changelog on a standalone OpenDJ server and have "cn=changelog" appeared as one of nodes. And my problem is, that after fetching data from "cn=changelog", attribute "changes" contains only new value of changed attribute, without the old one. E.g. when attribute "cn" changed from "Peter" to "Paul", in "changes" there is only "Paul". Is it possible to get also old value of attribute? If yes, could you tell me where should I search for it or how should I configure OpenDJ to obtain it?
cn=changelog returns the performed operations:
an add operation contains the whole entry being added,
a delete operation contains only the dn of the deleted entry,
a modify dn contains the old dn and new rdn,
a modify operation may contain either the new value only (in case of REPLACE modification type), the removed value (in case of DELETE modification type), the new value (in case of ADD modification type), or no value at all (in case of INCREMENT modification type). Note that the various modification types can be combined in the same modify operation, so you may see a DELETE + ADD, containing the old value, but this is not mandatory.
Ok, after digging in documentation (Procedure 8.15), I found out that there is possibility to set 'ecl-include' option, which causes that changelog entry contains new attribute - 'includedAttributes'. This attribute includes old values (before entry's modification) for those attributes which we defined in 'ecl-include' option. But the disadvantage is, that 'includedAttributes' contains all defined attributes - regardless if those attributes has changed or not during entry's modification. So, for my question, it should be configured like this:
dsconfig set-external-changelog-domain-prop -h host -p port -D cn="Directory Manager" -w password --set ecl-include:"cn"
From now on, next changelog entries will contain 'includedAttributes' attribute with old 'cn' value, which is 'Peter'.

Tortoise SVN property substitution - fails for more than one property "group"

I'm using TortoiseSVN 1.6.12, and seeing something very strange behaviour on property substitution. I have some svn:keyword properties (configured via TSVN) like this:
Author, LastChangedBy, Date, DateLastChanged
which I've applied recursively across every file in the codeset
I then did a simple test on a text file like this
Some text
$Author$
$LastChangedBy$
$Date$
$LastChangedDate$
When I commit my changes, the Author and LastChangedBy properties are substituted but not the Date or LastChangedDate ones. I did some experimenting around combinations and it appears that either the author properties are set, or the date ones (but never both). So it must be doing some validation based on property groups. (In TSVN, you can't simply created another svn:keywords entry, you're stuck with one).
Has anyone ever encountered this and/or is there a workaround?
The problem you have is simply based on that SVN only replaces keywords which are known to SVN.
You are using the following list of keywords set:
Author, LastChangedBy, Date, DateLastChanged
but you have placeholders set in your text file:
$Author$
$LastChangedBy$
$Date$
$LastChangedDate$
the known keywords are the following:
URL, HeadURL
Author, LastChangedBy
Date, LastChangedDate
Rev, Revision
LastChangedRevision
Id
Header
The problem you have that svn:keywords must exactly represents the keywords you would like to replace with values. But be aware that keywords are case sensitive. Furthermore you have defined a keyword "DateLastChanged" which does simply not exist and will of course not be replaced by SVN, cause it's unknown by SVN. On the other hand i assume you have a typo in your svn:keywords contents. may be you can copy&past the output of
svn pl . -v filename
on command line on that file. One point i missed before have you separated the keywords with a space?