Getting "Behind" on a branch - api

I am currently working on a power shell script where I want to get 'behind' on a specific branch
"$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/git/repositories/$(Build.Repository.ID)/stats/branches?name=$(Build.SourceBranchName)&api-version=6.0"
This works fine on branches Main, develop, and on any branches that are present in refs/heads/<branch_name>
but I continuously receiving error "the $(Build.SourceBranchName) does not exist on $(Build.Repository.ID)" whenever a branch is created on,
for example refs/heads/feature/<branch_name>
'

Related

Changes doesn't reflect on run time (code and design)

Im developing a system using vb2022 its almost done but today the changes I made doesn't reflect on run time.
For example I added a button but when I run the program the button will not show.
Same as the code, i can write code but it doesnt reflect on run time
Plus im trying to change the startup form into form 2 (initial is form 1) but it doesn't reflect.
What should I do? I didn't change anything I just opened the file and write code. But suddenly this happened.
Most likely your build is failing and VS is automatically running the old output. When that happens, VS will prompt you whether to run the old output or not by default, but many people tell VS not to prompt them again without actually reading the dialogue. Use the Build menu to build your project/solution and pay attention to the Output and Error List windows to see whether it failed or not.
It may be that the compilation is succeeding but VS simply can't overwrite the output files because they are locked, which does happen sometimes. In that case, just delete the entire obj and bin folders from your project folder. You may need to close VS to do so. The next time you build, new output will be created and run.
If this happens regularly then you should probably repair VS and, if it continues after that, reinstall.

How do I get IntelliJ to make new branches based on selected brach not HEAD?

Ocassionally I did hard reset on my current working branch. I restored all the changes lost but here I've another issue:
I have main branch named by dev_security.
I checkout it, I'm on it.
When I create new branch by selecting new branch from branches menu and give it test_branch name
it tells me that I've created branch from HEAD
Ok, I've deleted that branch.
When I am creating new branch by selecting the branch and them making new branch from it
Then it's ok and tells me that branch is created from dev_security
I am pretty sure before my hard reset operation it was the same and ALWAYS told me about creation from dev_security. How can I make it to behave the same?
git reset does not affect checkout action from IntelliJ UI.
In User Guide you can see the description of each action.
Therefore it is expected that you observe different behavior for different actions. There is no option to set the same behavior for different actions.
If you would like to see what commands exactly are executed when you perform different actions, then please open Git toolwindow, switch to "Console" tab and see what command exactly are executed.

Is test automation on CI/CD really trustable?

I was running a project with test automation on CI/CD and suddenly I got a question.
Is test automation on CI/CD really trustable?
The reason why I get this question is below.
For example, let's assume that I edit some codes on branch A and other codes on branch B and I make PRs.
As I made a test automation, The codes on branch A and branch B would be tested automatically and let's say two tests are passed.
However what if do the two parts of edited codes have no merge conflicts but interact each other and make bugs?
Then how could I trust the test automation and click the merge button?
A good question here, or, at least a situation that I have seen before. Branch A works fine, Branch B works fine but the combination of Branch A and B does not work.
I am going to assume that the automated tests catch the issue. So essentially flow of builds looks like this:
Tip of master passes.
Branch A passes.
Branch B passes.
Branch A is merged and tip of master passes.
Branch B is merged and the tip of master fails.
In this case the automation in CI/CD is trustable. As it accurately reports that the problem was caused by merging B. You can quickly return to a working state by:
Reverting the changes from B (at which point master is now passing).
Then you can get branch B ready to merge again.
Rebasing branch B on the current master.
Fixing the issue.
Testing / Reviewing and Merging branch B.
I am sure you are thinking that if you are the owner of Branch B then this is a lot of work for something you hoped would be caught prior to merge. However, typically in this environment you are trying to protect the state of the master branch. I.E. above all else the master branch is in a working state. The inconvenience to one developer is outweighed by the rest of the team being able to use the working master branch.
In terms of should you trust the automation and click the merge button. I personally avoid clicking the merge button late in the day. I trust that the automation will report issues, however, I don't trust that it is perfect. I prefer to merge in the morning where I have time to react if the build after the merge fails.

Bazaar Explorer hangs when parent branch is unreachable

I created a shared repository on my laptop. In that repository, I created a branch named trunk. Then I created an unbound branch of trunk on my desktop so I could do work on either machine and sync my changes manually.
This works pretty well except for one nagging issue. On my desktop, Bazaar Explorer is forever trying to reach the remote branch. Every time I hit Refresh (for example) Bazaar Explorer hangs for several seconds while it does ... something. If my laptop isn't on the network, Bazaar Explorer hangs for even longer and then displays the error message, "Not a branch: <branch URL>". Afterward, I can proceed as normal.
One of the reasons I switched to a DVCS from Subversion is that you can keep on working and commiting even when "the server is down". Technically, I can keep working, but the constant freezing is killing it for me. Is there a solution?
Edit .bzr/branch/branch.conf and remove the line with parent_location = ....
Note: later if you merge or pull from another branch, it will again save the parent_location. To prevent it from doing that, add the --no-remember flag when you merge or pull.
As #bialix pointed out in a comment:
if you want to disable remembering of parent_location you can also edit branch.conf and put there: parent_location = that is nothing (or space) after equal sign.

TFS History Lost

I have come across an issue that looks like TFS has permanently deleted a branch and all of its history and is not giving me the ability to interact with any of the changesets that were in that branch. Here is what happened:
I created a new branch(A) off of an existing branch(B).
I used A for a few months.
I merged everything in A back to B.
I deleted A by right clicking on the branch in Source Control Explorer and clicking delete and checked in the change.
[At this point I didn't check to see if A could be undeleted, and didn't notice anything amiss]
2 weeks pass
Now I want to view the history of a file that was merged
I go to the visual studio settings and check the box that shows all deleted items
A is nowhere to be found
I check to see if some other branches that I had deleted in the past were visible, and they are still present.
I look in the change history of the parent directory and I can't even see the changeset from when I deleted A.
I have admin access to the TFS database, but don't understand the schema well enough to search for all "delete" changesets.
I've tried to use the API in Microsoft.TeamFoundation.Client to get more information, but it isn't providing any more records that the TFS history window did
Update
I just ran a a tf destroy command on a test branch to see what the symptoms are, and the symptoms are consistent with what I'm experiencing. I suspect that this branch was destroyed, now my goal is to find out if destroy leaves behind any information about who or when
Further investigation reveals that a team member on a different project had run a cleanup script during the two week period that had invoked the destroy command, accidentally destroying some of our deleted branches. The advice in How to find out who ran the TFS Destroy Command? revealed who it was, and how it had happened.