Update a variable group snapshot for an Azure DevOps release - variables

I have an Azure DevOps release pipeline that references several variable groups, with each stage in the release being linked to a different group.
When I first deploy to a stage, one of the values required for that variable group cannot be known (a key for a function on a Function App). However, it's required for some post deployment checks that need to be completed.
It's not ideal, but I thought I'd be able to do the deployment, have it fail, update the variable group and then try again. This is based on the following statement when you edit a release -
You can edit approvals, tasks, and variables
However, it seems that if you edit a variable group there is no way to pull the updated values in to the release. This means that the only way I can get my deployment out is to create a second release.
I'm really hoping that I'm missing something, because other tools (e.g. Octopus) offer this functionality out of the box. Is it possible to update a variable group snapshot for a release?

Variable group snapshot cannot be modified in the deployed release currently. Azure devops release doesnot support this feature yet.
However, variables defined under Variables tab can be modified in previously deployed release.
So as workaround, you can define a variable which has the same name under Variables to override the variable defined in the variable group. (For example, i have a variable Name in variable group, then i defined a new variable under Variables also named Name)
See below:
1, Edit your release and choose Edit release
2, Click Variables tab --> Add a new variable(eg. Name) which has the same name with the variable in the variable group--> Save
3,After saving the changes. Go to Pipeline tab--> to Redeploy your release. Then the updated values will be pulled in to the release
You can click here to submit a user voice(Click suggest a feature and choose Azure Devops)to Microsoft Development team. Hope they will consider adding this feature in the feature sprint

Related

Setting "Flags" for a run in Atlassian Bamboo

When looking at the list of recent builds for a Plan in Bamboo, there is column in the summary called "Flags". It contains values like "Custom build" (if you started the build manually using "Run customized") and "Custom revision" (if you ran the build against something other than the head of master).
Is it possible to add a step to my Plan that potentially puts my own value in this field for the current build? In particular, I want to have logic that does this based on build variable, basically saying "if this variable equals this value, then add this custom tag to this build" and have the tag show up in that column of the summary, letting me see whether each build used that specific value for the build variable.
I believe what you may be looking for will require two plugins created by Atlassian:
Conditional Tasks for Bamboo. This will allow you to trigger tasks based on variables.
Inject Variables. This will allow you to set certain variables in your tasks which can even be picked up by the other plugin.

TFS CI build trigger include variable

Is it possible to use a variable as build trigger? I've tried and the build doesn't get triggered. If I remove the variable and insert a value, the build gets triggered as expected.
Aren't variables allowed here? $(Mapping.ServerPath) is set to MyRepo/Branches/MyBranch. $/MyRepo/Branches/MyBranch triggers the build correctly.
No. And why should they?
The specified path results in a poll action being performed on the static path.
You can use wildcards if needed.
The build should trigger on a change, hence CI trigger.
Making the path a variable, when would you provide it?
If it's just keeping a static value elsewhere, why not fill it in?
If you want to provide the path when calling the build.
Then you don't intend to use the CI option as intended?
No, it is not supported.
There is a user voice that you can follow: Allow Variables in Repository, variables and triggers Tab.
We have a microservice architecture with dozens of builds, it makes sense to be able to use a variable that we can update when we start our next iteration. With our branching strategy we have a new branch for each sprint and for each release. Changing the CI trigger in every build every couple weeks is inefficient.
We are using on premise TFS2018 and from everything I've seen this is not supported.

#Object already exported, no package change is possible" while mass package assignment

I need to change a package for ~250 SAP development objects (ABAP classes, data elements, tables, etc). I'm getting an error message TR242 (Object already exported, no package change is possible) when I'm trying to do the change via se24/se80 transactions or via RSWBO052 report.
SAP help docs say that the object must be copied under new name, the old one must be deleted and the new one must be renamed to the old name back. However, it's not a good way for 250 objects.
Is there any way to do a mass package change except call tranaction/LSMW for this case?
The problem occurred because I was trying to move the development objects to a non transportable package as #vwegert metnioned above. The target package was marked as non transportable because it was marked as a legacy one. This happened because the target package was moved from a system with basis level lower then the current system basis level. Next steps are necessary to resolve the issue:
The legacy package must be migrated via report RS_MIGRATE_PACKAGES (see note 1711900). The mark 'legacy package' will be removed, but the package will be still non transportable. However, you will be able to recreate the package after the migration.
Delete the non transportable target package and create a new as copy of the non TMS package.
Assign all necessary objects to package created at step 2 using RSWBO052 report.
This message occurs if you try to move objects from a transport-enabled package to a non-transportable package like $TMP. The rationale behind this is:
The object once was in a transportable package, so it must have been added to at least one transport request.
The transport request might have been transported to another system (directly or via ToC), so the other system might have that object.
The current system is the original system of the object, so it is responsible for notifying the other systems (via transport) when the object is to be deleted.
Moving the object to a non-transportable package is semantically equivalent to deleting it for the rest of the system landscape.
Since that process happens very infrequently, it's usually sufficient to direct the developer to copy and delete the object.

How to permanently save a build variable as a build step?

I have the following variables defined:
Now once a build is complete (the last step in the build process), I want to update the VersionRevision variable, basically increment it.
So I'm looking for an API I can call from C# and create a console application or a powershell script to edit the build definition (if I have to do this)?
You can use VSTS Rest API to update the variable value in Build Definition. Both Console Application and Powershell Script is OK for this.
If I understand correctly, you want to get these build variables and them assignment them as your version number.
After the build completes, update and increment the VersionRevision. It's not a good way and seems not available to achieve it.
In TFS build there is a $(Rev:.r) which means
Use $(Rev:.rr) to ensure that every completed build has a unique name.
When a build is completed, if nothing else in the build number has
changed, the Rev integer value is incremented by one.
Source: Specify general build definition settings
To version your assemblies you could just add an powershell script in your build definition, detail ways to achieve please follow this link from MSDN: Version your assemblies
And usually we only define and assignment variables with the Major and Minor version. If you want to change the value of them. You may need manually edit the build definition.
More related link about how to manage version numbers as part of your vNext builds.
vNext Build Awesomeness – Managing Version Numbers
Generate custom build numbers in TFS Build vNext

QTP adds object to local repository while doing Update Run mode

I have created total 50 test scripts. All these scripts use almost same objects so I have created a Shared Repository to ease the maintenance work.
But the problem is...
While executing scripts in Update Run mode, QTP adds some objects in local repository even if they are present there in Shared Repository. I have checked properties of these newly added objects and there are no change in that too.
Anybody please tell me the logic QTP uses to decided whether to add a object to local repository or not.
Also tell me a solution so that no object is added to the local repository.
There are two things at work here.
QTP opens Shared Object Repositories (SORs) in read only mode
since SORs are by definition shared, QTP wants to make sure that
when someone makes a change to a SOR he is aware that many tests may
be affected. Therefore in order to edit a SOR you have to use the
Object Repository Manger and no changes are made to a SOR
automatically (Update Run Mode or Maintenance Run Mode)
When adding an object to the object repository QTP first checks if the object already exists (by comparing properties) if it does it reuses the existing object and doesn't make a new entry.
This explains why you're getting objects in the Local Object Repository (LOR) and not the SOR, (I'm not sure if having unmodified objects added to the LOR is the correct behaviour or not).
In order to propagate the changes after the Update Run Mode you should export the LOR to a new SOR and then merge it with your existing SOR.
I also faced similar kind of problem. While execurting script qtp was not identifying an object although object was present in shared OR and it was highlighting in application. when i checked in maintenance run mode there was a change in one prperty value which i updated in shared OR. The problem was I spy on that object and qtp saved it in local OR. so next time when i run the script it was refering from local OR and script was failing. so i deleted object (which was showing as Local) from object repository window , then it displayed the same object of shared OR (which was QC path)