Using the TFS API, filetypes with extensions like .svnExe get ignored - tfs-sdk

I'm working on a tool which migrates from SVN to TFS using the TFS API.
workspace.CheckIn(
pendingChanges,
currentUser.TfsUser,
set.LogMessage + " on " + String.Format("{0:d/M/yyyy HH:mm:ss}", set.TimeStamp) + " by " + currentUser.SvnUser,
(CheckinNote)null,
(WorkItemCheckinInfo[])null,
(PolicyOverrideInfo)null
);
This is the way i check my revision in, but sometimes it ignores files like .svnExe, or other "unknown" file types.
Is there a way to check ALL filetypes in TFS?

There are two possibilities that I can think of:
Possibility 1: Something is causing the PendAdd() to fail.
For example, if the path already exists in Version Control, you have to use a PendEdit() instead.
To diagnose this possibility, you should subscribe to the VersionControlServer.NonFatalError event.
Possibility 2: You could have a corrupt workspace cache
You can refresh the cache by calling Workstation.Current.EnsureUpdateWorkspaceInfoCache() or by following the steps in this answer (run tf workspaces /collection:http://yourserver:8080/tfs/DefaultCollection, or delete the directories manually).

Related

Qlik Sense: how to specify path in Google Drive?

I have a Google drive account divided into some folders (say, Folder1, Folder2, etc.), with some subfolders in it.
I successfully managed to connect my Qlik Sense app to it.
I need to make it look for files only in a given subfolder.
At the moment, I read as follows ([...] is the location)
(URL IS [[...]connectorID=GoogleDriveConnector&table=ListSpreadsheets&appID=], qvx);
It works and reloads successfully, but I need it to filter the Spreadsheets properly. How could I get what I need?
To connect to Google Drive in fact you use web connector. Once web connector is installed it can be initialized as service or manually from its folder.
Once it i installed (recent version can be downloaded from https://qliksupport.force.com/apex/QS_Home_Page but it seems that you've got it as Google Drive is part of it ) it is much nicer to configure connection to online drives there.
You just go to http://localhost:5555/web and generate ready code.
In my implementation I used following options step by step to get data which I wanted:
1) CanAuthenticate to generate permanent token
2) ListSpreadsheets
3) ListWorksheets
4) GetWorksheet
You can't just specify path. But it's possible to retrieve the path from QWC services. Please use algorithm like that:
Use tables like ListFiles/ListWorksheets
Iter through every row with 'for' cycle:
FOR i=0 to (NoOfRows('Google_ListWorksheets')-1);
Let vWorksheetKey = Peek('worksheetKey', $(i), 'Google_ListWorksheets');
Let vTitle = left(Peek('title', $(i), 'Google_ListWorksheets'),3);
Using 'if' statement find desired folder id/worksheet key by its name (stored in vTitle variable) and use it:
load * FROM [$(vQwcConnectionName)]
(URL IS [http://localhost:5555/data?connectorID=GoogleDriveConnector&table=GetWorksheet&worksheetKey=$(vWorksheetKey)&appID=], qvx);
At the end you will get your files by their location.

How to enable/disable a particular bbappend for a specific MACHINE in Yocto

I'm trying to understand the mechanism Yocto provides to enable/disable a particular bbappend for a specific MACHINE. I read this link (Modifying Variables to Support a Different Machine):
https://www.yoctoproject.org/docs/1.5/dev-manual/dev-manual.html#best-practices-to-follow-when-creating-layers
And also found some information related here on stack overflow:
Machine specific layers in yocto
I have tried putting all this information into practice without any success. This is my particular problem:
A BSP layer for an "x" platform provides a qtbase_%.bbappend that modifies qtbase recipe from meta-qt5. I need this qtbase_%.bbappend only applying when building for MACHINE="x", but not for other different machines.
This is the content of the original qtbase_%.bbappend defined on the x-bsp-layer:
PACKAGECONFIG_GL = "gles2"
PACKAGECONFIG_FONTS = "fontconfig"
PACKAGECONFIG_APPEND = " \
${#bb.utils.contains("DISTRO_FEATURES", "wayland", "xkbcommon-evdev", \
bb.utils.contains("DISTRO_FEATURES", "x11", " ", "libinput eglfs gbm", d), d)} \
"
PACKAGECONFIG_append = " ${PACKAGECONFIG_APPEND} kms accessibility sm"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
PACKAGECONFIG_remove = "evdev"
Whenever I try to build an image for a MACHINE different from "x", the compilation is broken:
| ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.
| ERROR: Feature 'eglfs' was enabled, but the pre-condition '!config.android && !config.darwin && !config.win32 && features.egl' failed.
| ERROR: Feature 'gbm' was enabled, but the pre-condition 'libs.gbm' failed.
Removing the x-BSP-layer from bblayers.conf solves the problem, but that's not the kind of solution I am looking for.
I tried fixing this using information provided in previous links. I modified qtbase_%.bbappend recipe in this way:
PACKAGECONFIG_GL_x = "gles2"
PACKAGECONFIG_FONTS_x = "fontconfig"
PACKAGECONFIG_APPEND_x = " \
${#bb.utils.contains("DISTRO_FEATURES", "wayland", "xkbcommon-evdev", \
bb.utils.contains("DISTRO_FEATURES", "x11", " ", "libinput eglfs gbm", d), d)} \
"
PACKAGECONFIG_append_x = " ${PACKAGECONFIG_APPEND} kms accessibility sm"
FILESEXTRAPATHS_prepend_x := "${THISDIR}/${PN}:"
PACKAGECONFIG_remove_x = "evdev"
As you can see, I appended the "_x" suffix to all recipe variables. It's supposed (at least that it's what I understand) those "_x" make the variable being assigned just in case the PLATFORM="x" is defined. Right? But it doesn't work as expected, it generates the same problem. So, in practice, this means I don't understand even the basics of this mechanism.
Can some of you provide a good explanation for this? I think it should be helpful for others with the same issue out there. Thanks a lot for your time! :-)
Just add COMPATIBLE_MACHINE = "x" in .bbappend file.
As you can see, I appended "_x" suffix to all recipe variables
Remove all "_x" suffix in .bbappend file.
Note adding COMPATIBLE_MACHINE as suggested would change the signatures of the original recipe, which is bad practice, and would result in your layer failing the compatibility test carried out by the yocto-check-layer script. Consult this for details.
The correct way of making a .bbappend file machine-specific is through overrides, as you're already doing in your proposal. Why it still fails is a different question. I suggest you to inspect the variables of the recipe through bitbake, and switch machines to verify they change accordingly.

How can I create trac tickets from an svn commit?

I'm looking for a way to create (not update) a trac ticket in response to a commit message like "Hack code to not kill your dog (TODO: fix this properly to avoid chasing kittens instead)".
I want the trac system to react on the "TODO" keyword and create a ticket with the content of the commit message, the owner set to the committer and the opening commit already referenced.
While searching on SO I found Open and close trac tickets with a single commit which basically says how I could roll my own solution. Which I'd do if there isn't a pre-made one available. So - is there?
I would suggest looking at the official Trac package for python: http://pypi.python.org/pypi/Trac/0.11.4 and docs http://www.edgewall.org/docs/tags-trac-0.11.7/epydoc/trac-module.html
This is what we use to create tickets in Trac from a python script and I think it's fairly simple to use. You could run this python script as a post commit hook for your VCS.
You can start up a trac environment using your project settings and then new up tickets and save them. There's probably a little more to it for you, but this should give you a good idea:
from trac.env import Environment
from trac.ticket import Ticket
env = Environment(projectSettings, create=0)
tkt = Ticket(env)
tkt['summary'] = 'first line of commit message'
tkt['description'] = 'full commit message'
tkt.save_changes(commitAuthor, '')
Needless to say, current Trac stable is 0.12.3, but of course development needs to go with your current version. (You didn't tell us in you question.)
On you question, there is a hint on how to implement different functionality on-top of the CommitTicketUpdater from Trac core. It has update and close as built-in actions, so you'll need to do some change like so (based on current Trac trunk):
create an additional option commands_create for commands, that create a new ticket with reference to the changeset, as a space-separated list
add a class-wide variable self.comment in both of changeset_added and changeset_modified right after comment assignment
add a module cmd_create like (untested)
def cmd_create(self, ticket, changeset, perm):
if not self.check_perms or 'TICKET_CREATE' in perm:
# Commit messages in general is used for a ticket comment.
# New tickets require summary and we'll want description too,
# because comment is ignored on ticket creation.
# So we need to do message processing here beforehand.
ticket['comment'] = None
ticket['description'] = self.comment
ticket['owner'] = changeset.author
ticket['status'] = 'new'
ticket['summary'] = ' '.join(['TODO from', str(changeset.rev)])
ticket.insert()
alter ticket_command so the regexp matches not only the default function-ticket(s) pairs but the unary 'TODO:' as well (sorry, can't make this working right-away now)
extend the private module _parse_message to include another case before if func:
if cmd.startswith('TODO'):
tickets.update({None : ['create']})
continue
change _update_tickets to make the comment saving conditional, because you won't need/want an additional comment on new tickets)
if ticket['comment']:
ticket.save_changes(changeset.author, comment, date, db)
Ok, ask back as required, if you like to try this approach.

MsTest, DataSourceAttribute - how to get it working with a runtime generated file?

for some test I need to run a data driven test with a configuration that is generated (via reflection) in the ClassInitialize method (by using reflection). I tried out everything, but I just can not get the data source properly set up.
The test takes a list of classes in a csv file (one line per class) and then will test that the mappings to the database work out well (i.e. try to get one item from the database for every entity, which will throw an exception when the table structure does not match).
The testmethod is:
[DataSource(
"Microsoft.VisualStudio.TestTools.DataSource.CSV",
"|DataDirectory|\\EntityMappingsTests.Types.csv",
"EntityMappingsTests.Types#csv",
DataAccessMethod.Sequential)
]
[TestMethod()]
public void TestMappings () {
Obviously the file is EntityMappingsTests.Types.csv. It should be in the DataDirectory.
Now, in the Initialize method (marked with ClassInitialize) I put that together and then try to write it.
WHERE should I write it to? WHERE IS THE DataDirectory?
I tried:
File.WriteAllText(context.TestDeploymentDir + "\\EntityMappingsTests.Types.csv", types.ToString());
File.WriteAllText("EntityMappingsTests.Types.csv", types.ToString());
Both result in "the unit test adapter failed to connect to the data source or read the data". More exact:
Error details: The Microsoft Jet database engine could not find the
object 'EntityMappingsTests.Types.csv'. Make sure the object exists
and that you spell its name and the path name correctly.
So where should I put that file?
I also tried just writing it to the current directory and taking out the DataDirectory part - same result. Sadly, there is limited debugging support here.
Please use the ProcessMonitor tool from technet.microsoft.com/en-us/sysinternals/bb896645. Put a filter on MSTest.exe or the associate qtagent32.exe and find out what locations it is trying to load from and at what point in time in the test loading process. Then please provide an update on those details here .
After you add the CSV file to your VS project, you need to open the properties for it. Set the Property "Copy To Output Directory" to "Copy Always". The DataDirectory defaults to the location of the compiled executable, which runs from the output directory so it will find it there.

extra-paths not added to python path with zc.recipe.testrunner

I am trying to run tests by adding a version of tornado downloaded from github.com in the sys.path.
[tests]
recipe = zc.recipe.testrunner
extra-paths = ${buildout:directory}/parts/tornado/
defaults = ['--auto-color', '--auto-progress', '-v']
But when I run bin/tests I get the following error :
ImportError: No module named tornado
Am I not understanding how to use extra-paths ?
Martin
Have you tried looking into generated bin/tests script if it contains your path? It will tell definitely if your buildout.cfg is correct or not. Maybe problem is elsewhere. Because it seem that your code is ok.
If you happen to regularly include various branches from git/mercurial or elsewhere to buildout, you might be interested in mr.developer. mr.developer can download and add package to develop =. You wont need to set extra-path in every section.