Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Workitem is not associated while doing checkin with tf.exe #191

Closed
fforjan opened this issue Apr 26, 2017 · 14 comments
Closed

Workitem is not associated while doing checkin with tf.exe #191

fforjan opened this issue Apr 26, 2017 · 14 comments

Comments

@fforjan
Copy link

fforjan commented Apr 26, 2017

When trying to associate work items for checkin, my checkin is rejected:

tf checkin -noprompt ******** myproject\.tfignore myproject\.vscode\settings.json -comment:Update tfignore for UILess project  #492455 - Arch - Sprint 3 General Items
[Checkin] TF10139: The following check-in policies have not been satisfied:   The Work Item Query Policy failed because no work items were associated with this check-in.  No files checked in.

I've used the associated item and picked one (the #492455 which was added to the comment line) but this is not added.
While reviewing the tf.exe command line, I found this :
https://social.msdn.microsoft.com/Forums/vstudio/en-US/33830525-ede9-48ca-adcf-a8e820b4b3ba/how-to-associate-work-item-information-with-tfexe-checkin-command-?forum=tfsversioncontrol

Which means the current approach is 'broken' for us which requires (MUST HAVE) associated workitems ?

@jeffyoung
Copy link
Contributor

Hi @fforjan. Yes, I should have known this (and thanks to the link with the bug report from 2008!).

While tf.exe doesn't support it (and a few other things like not forcing it to return English strings to parse), the Team Explorer Everywhere Command Line Client (TEE CLC) does support associating work items.

However, in order to use the TEE CLC on Windows, you need to do the following (this information is taken from the TFVC_README; specifically this). (While the TEE CLC is primarily for macOS and Linux users it can also be used on Windows.)

  • Download and install a version of Java 8 for Windows.
  • Ensure that that path to java.exe is a part of your PATH environment variable.
    • Mine ends up being set to C:\ProgramData\Oracle\Java\javapath\
    • Check that you can successully run java -version
  • Download and unzip the TEE CLC to a local folder of your choice.
  • Open a command prompt and run {path-to-tf.cmd} eula and accept the End User License Agreement.
  • Update your tfvc.location to the full path to tf.cmd (e.g., C:\TEE-CLC-14.111.1\tf.cmd).
  • The last thing that you have to do is run the tf workspaces command as detailed here so that the CLC is aware of the workspaces in the specified collection. (Each tool, tf.cmd and tf.exe, keeps a local cache of workspaces.)

There's also a video that shows how to do this on Linux (the same high-level steps apply on Windows).

After you do all that, you'll be using the TEE CLC with that workspace. If you put the tfvc.location setting in your VS Code workspace settings, it will only use it for a particular folder (instead of all folders). That might apply.

So if you're willing to do all of that, you can get associate work items going (to satisfy your checkin policies).

Another option would be for me to provide the ability to bypass the checkin policies (since they're client-side policies) via an extension setting. But then you'd have to go back to the server and do the work item association manually.

Updating tf.exe itself would be a much longer-term solution (but you're already aware that it's been almost 10 years).

Let me know what questions you have (I'd be happy to work through it).

@jeffyoung jeffyoung changed the title Workitem is not associated while doing checkin Workitem is not associated while doing checkin with tf.exe Apr 27, 2017
@fforjan
Copy link
Author

fforjan commented Apr 28, 2017

@jeffyoung I don't want my team to bypass the rule, the scrumm master is not going to be happy and it will raise red line in our project manager report ;)
I will try it but next week, I'm in personal trip in France for the moment !

@jeffyoung
Copy link
Contributor

Hi @fforjan. I just wanted to check in and see if you were ever able to try this out (and, hopefully, get it working)?

@fforjan
Copy link
Author

fforjan commented May 16, 2017

Excluding and Including files is very slow on my computer when using TEE, close to not be usable.
I will record a video and share it with you.
In the current state, I cannot recommend the usage of TEE to my team :/

@nukec
Copy link

nukec commented Jun 4, 2017

Have the same issue, is this fixed? This is unusable, if there is requirement to add work item(which should be by default requirement).

@jeffyoung
Copy link
Contributor

This issue is particular to TF.exe (as the TEE CLC supports associating work items). Although I've filed a bug against TF.exe about lacking the support for associating work items for TFVC repositories, the issue has been around a long time (https://social.msdn.microsoft.com/Forums/vstudio/en-US/33830525-ede9-48ca-adcf-a8e820b4b3ba/how-to-associate-work-item-information-with-tfexe-checkin-command-?forum=tfsversioncontrol). I don't expect TF.exe to be updated anytime soon.

Unfortunately, the only workaround in VS Code that I'm aware of is to the use the TEE CLC (like I described above) which does support associating work items on check-in. I would expect Visual Studio (the IDE) to be able to do this as I don't believe it uses the TF.exe directly (I believe it uses direct SOAP calls and updates the work items that way).

@jeffyoung
Copy link
Contributor

The only other option would be to run tf checkin at the command line (perhaps from the VS Code terminal) which should pop UI that would allow the association of work items. In that way, you'd be using VS Code to make your changes, include and exclude, but would need to interactively run tf checkin.

It's certainly unfortunate that TF.exe doesn't support this (and hasn't for a long time).

@pollusb
Copy link

pollusb commented Oct 18, 2017

I resolved this by using team explorer seperatly for the moment.

@nukec
Copy link

nukec commented Oct 19, 2017

@pollusb erm yeah, well is there any other option? That's work around, not solution hehe. But yeah, still not implemented I guess? @jeffyoung any update on this? Thanks

@kaylangan
Copy link
Contributor

@nukec you can type "#" into the commit box directly as a workaround.

@dfaroi
Copy link

dfaroi commented Oct 11, 2018

#433

@StavM
Copy link

StavM commented Nov 27, 2018

Any progress on this issue ? isn't it as simple as adding a configuration key to the tfvc.settings to toggle adding and removing the '-noprompt' key from the TF.exe commands ?

@serhaton
Copy link

serhaton commented Mar 6, 2020

Any update please ?
This is still an issue with version 1.42.1
#12345 does not work either from the comment box.

Thanks

@tititestor
Copy link

tititestor commented Oct 9, 2020

To override checkin policy i have modify checkin.js file (.vscode\extensions\ms-vsts.team-1.161.1\out\src\tfvc\commands), and now i can temporaly checkin from vs code

GetExeArguments() {
        const builder = new argumentbuilder_1.ArgumentBuilder("checkin", this._serverContext, true /* skipCollectionOption */)
            .AddAll(this._files);
        if (this._comment) {
            builder.AddSwitchWithValue("comment", this.getComment(), false);
	    builder.AddSwitchWithValue("override", "Titi", false);
        }
        // TF.EXE doesn't support associating work items with checkin
        //builder.AddSwitchWithValue("associate", this.getAssociatedWorkItems(), false);
        return builder;
    }

Maybe have override setting can be an interesting option

Titi

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants