Microsoft Azure DevOps Repo: search for text/code in specific branch - c#

I'm embarrassed to ask what should be a simple thing to figure out....
However, when I'm viewing a specific branch in an Azure DevOps repository online (e.g., when reviewing a PR), I can't figure out how to perform a search of that branch's code.
I see a global search textbox at the top, as follows:
And I see a textbox for searching the branch for file/folder names, as follows:
But what I don't see is a textbox for searching the contents of the files in that branch....e.g. for finding occurrences of someFunction() or somePropertyName or whatever inside the code files for that particular branch.
Did Microsoft really omit this functionality? Or am I missing something? How do we perform such a search?

First, input content in the global search textbox at the top and search:
Now, you can select your repo and branch the dropdown list:
By default, code search only applies to your default branch. You may add up to 5 more here:
Please notice that when a new branch is configured for search via “include/exclude searchable branches”, the branch list of search is not immediately populated with the newly configured branch. This happens because it takes some time to on-board a new branch and make is searchable. It takes up to 12 hours to fully initialize the branch.
You can also refer to this document about search your code.

what they aren't telling you (and I just went through this today) is that you have to have a "successful" search in order to get the Branch: filter to appear & be selectable. "Failed" searches give you all the filter dropdowns but you cannot change them.

In fairness you'd just be better off actually Doing a Pull and using git to search the code then ..

Related

Generate TFS query url for a specifc set of tags

I have a c# webapp which is a build tool for my company. We want to be able to show a URL which answers which workitems were addressed in this build. We have the users use a TFS tag value for the build. So what we want is to use a stored query and pass it the TFS tag. I'm assuming that the querystring would have the tag value that I'm looking for. We currently do something similar with changesets: https://tfs.corp.inc/tfs/DefaultCollection/CorpInc/_versionControl/changeset?id=74682
We want to have something similar for workitems. We want that url. Can anyone help me with this? Thanks.
1). To get associated work items in one specific TFS build, you need to firstly use the InformationNodeConverters.GetAssociatedChangesets(IBuildDetail) method to get the assoicated changesets. Then use the Changeset.WorkItems property to get the associated work items. Check this MSDN case link for the details: https://social.msdn.microsoft.com/Forums/vstudio/en-US/92766815-c09b-422b-91fc-5e745e3aaa21/tfs-2010-how-to-query-workitems-by-build?forum=tfsgeneral
2). After these associated work items are found and applied with specific tags, and there is one saved query to list all work items with that tag. To get URL with that work item query, one simplest method is open that work item query in TFS web access, and then click "Copy query URL". You will then get the work item query URL to be similar to: https://tfs.corp.inc/tfs/DefaultCollection/CorpInc/_workitems?tempQueryId=b124db9d-26e5-4a5c-94c7-0233d99faf56

How can I copy HTML textbox values from one domain to another domain's textboxes?

I'm trying to help save time at work with for a lot of tedious copy/paste tasks we have.
So, we have a propitiatory CRM (with proper HTML ID's, etc for accessing elements) and I'd like to copy those vales from the CRM to textboxes on other web pages (outside of the CRM, so sites like Twitter, Facebook, Google, etc)
I'm aware browsers limit this for security and I'm open to anything, it can be a C#/C++ application, Adobe AIR, etc. We only use Firefox at work so even an extension would work. (We do have GreaseMonkey installed so if that's usable too, sweet).
So, any ideas on how to copy values from one web page to another? Ideally, I'm looking to click a button and have it auto-populate fields. If that button has to launch the web pages that need to be copied over to, that's fine.
Example: Copy customers Username from our CRM, paste it in Facebook's Username field when creating a new account.
UPDATE: To answer a user below, the HTML elements on each domain have specific HTML ID's. The data won't need to be manipulated or cleaned up, just a simple copy from ourCRM.com to facebook.com / twitter.com
Ruby Mechanize is a good bet for scraping the data. Then you can store it and post it however you please.
First, I'd suggest that you more clearly define exactly what it is you're looking to do. I read this as you're trying to take some unstructured data from Point A and copy it to Point B. Do the names of these fields remain constant every time you do the operation? Do you need to simply pull any textbox elements from the page and copy them all over? Do some sort of filtering of this data before writing it over?
Once you've got a clear idea of the requirements, if you go the C# route, I'd use something like SimpleBrowser. Judging by the example on their Github page, you could give it the URL of the page you're looking to copy, then name each of the fields you're looking to obtain the value of, perhaps store these in an IDictionary, then open a new URL and copy those values back into the page (and submit the form).
Alternatively, if you don't know the names of the fields, perhaps there's a provided function in that or a similar project that will allow you to simply enumerate all the text fields on the page and retrieve the values for all of them. Then you'd simply apply some logic of your own to filter those options down to whatever is on the destination form.
SO we thought of an easier way to do this (in case anyone else runs into this issue).
1) From our CRM, we added a "Sign up for Facebook" button
2) The button opens a new window with GET variables in the URL
3) Use a greasemonkey script to read those GET variables and fill in textbox values
4) SUCCESS!
Simple, took about 10 minutes to get working. Thanks for you suggestions.

Searching through hundreds of HTML files

I am not sure how to start solving this problem so any suggestions will be of help.
My client has a number of static HTML pages running into hundreds of files. These under go updates every now and then and are overwritten on the website. We list these pages on the website via a simple left hand side explorer mimicking the folder structure in which these files are given to us.
We now want to give the ability to search these files and display matching results. Doing a brute search through such a large number of files is going to be very time consuming. Matching related words (for example plurals, misspellings etc) is also desirable. Showing results in the order of popularity would be a useful feature. I am not sure how to get started on this. Should we pre-process the html files after every update for instance? Any recommended indexing libraries available in .NET? What little programming has been done on the website has been done using C#.
Thanks
MS
Lucene.net may be of interest.
I´d first write a simple program to transfer all those files contents to a database. Then you could implement your search properly without having to read all files every time.
I am not sure if its within your budget, but Google can do it for you as user1161318 pointed out.
Try Google Site Search - http://www.google.co.uk/enterprise/search/products_gss.html

ASP.NET MVC Selectable Tree/Grid/Search Data View

I'm working on a web app in ASP.NET MVC 3 using the Razor HTML 5 engine and C#. The client wants something pretty complex and I would like to know if there is any examples out on the web that might show me how to begin setting this up. Here's what they are looking for:
I have a very large SQL database (25,000 rows). They want to be able to select the data using three different views on the same page.
The first will be a tree and using similarities in certain columns of the table will be how the tree is broken in to sections.
The second will be a grid. This will be just one entire list of the everything in the database that you can scroll through. Of course there has to be some sort of virtual scrolling because loading 25,000 rows rather quickly isn't going to happen.
The third will be a search box where you can type in the code and select it that way.
All three of these need to be linked so that when you type a code in the search box it will select it in the grid and in the tree. If you select it in the tree then it will be selected in the grid, and if you select it in the grid then it will be selected in the tree.
They also want me to remember the last selection when you navigate away and be able to type a code n on a different page and go directly to this page with the item you typed selected. Therefore, I need to be able to use MVC's capabilities to establish a hyper link for every item in the list (I assume that would be the way to do this)
This is honestly the first time I've worked with ASP.net MVC and I feel like I may have bitten off more than I can chew with this project so any help would be greatly appreciated!
They would rather it if I didn't need to include any extra dll's so if there is a way to do this without third party tools that would be even better, but at this point I'm just looking for anything.
A few random ideas/thoughts about this:
This is kind of a big project as your first MVC app - hopefully you have some experience with HTML/Javascript/jQuery since it's going to require a fair amount of glue code to make everything work together. There is no "here, do this" solution.
There are a bunch of different free/open source projects for treeviews and grids. I've used jqGrid for a number of projects - it works well. It has a decent API and is fairly configurable (although it may take some digging to find the example code you need).
For a treeview, you can try jsTree. I haven't worked with it, though.
I'd suggest starting with just the treeview, or just the grid and get it working first. Then add the other control and get it working. Then add the search. Finally, I'd work on getting everything to work together.
To handle navigating to a specific selection, you can pull information off the query string from Javascript.
Realize that most of this is going to be happening in Javascript on the client side, not much server side.

Custom Windows 7 Start Menu Search Provider

I'd like to write custom providers for start menu searching, but I can't seem to find where to begin.
Things I'd like to be able to do when I type in the search box on the start menu
Type "thomas" and see "IM Thomas" (if a Pidgin/whatever-IM-client-with-API contact exists with the name match)
Type "=1+2*3" and see "7", or "=2 gallons in ounces" and see "256"
Anything else I can think up where I have a store of custom data results that could be launched from the start menu. This would be especially useful for custom applications, letting our users type "order XYZ", which would search orders in the application and let the user open them from the start menu.
I'm not looking for a tool to do this for me. Rather, I'd like to find any documentation on writing custom search result providers, ideally in C#.
I believe you are looking for the Windows 7 API Code Pack for .NET.
On a related note, you can add all kinds of searches to your favourites in Windows Explorer. Check out Windows 7 Search Federation Providers.
Scott Hanselman's blog covers how to create a simple search connector by creating .osdx files, which are XML files that configure which URL(s) to invoke with the search terms. He then shows how to enable those connectors from within the start menu itself by adding entries to the registry.
You might want to look into SlickRun a search bar alternate/replacement. While I dont think it can be put in the place of the actual start menu search, going to thier site and getting involved will probably get you a lot closer to where you want to go.
For all I know, the functionality you describe may already be an option.
I just discovered Start++, which has plug-in support (it appears to use JavaScript with Windows Scripting Host).

Categories

Resources