Skip to content

Create end-to-end sample for an indexer #12900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2020
Merged

Conversation

heaths
Copy link
Member

@heaths heaths commented Jun 20, 2020

Includes AI enrichments. Fixes #12518

@heaths
Copy link
Member Author

heaths commented Jun 21, 2020

I added .gitattributes to force line endings to use LF:

countries.txt text eol=lf

All tests passed on my machine. However, on Windows agents it still got checked out to the working directory with CRLF. Upon checking this branch back out (I had switch to another branch without this file), it's checked out with CRLF again. https://www.git-scm.com/docs/gitattributes#_effects confirms this should've worked. I may instead have to implement a TextReader to normalize line endings across platforms.

@heaths
Copy link
Member Author

heaths commented Jun 21, 2020

@weshaggard is this change fine to add a line to .gitattributes? Originally I tried a file in a subdirectory but later remembered that only works for .gitignore. I need to force the line endings to LF. If not, I could write a TextReader that normalizes the line endings while the file stream is being read, but this easier to maintain.

@heaths
Copy link
Member Author

heaths commented Jun 22, 2020

I could also just "pretend" to read from a file for the sample's purpose, and in a line prepended with /*@@*/ that our sample code extractor will ignore, actually pull from a C# string literal that would be delimited by \n only. It would be nice - though not required - if we actually read from a file, though, in case customers actually look at the full sample source.

@weshaggard
Copy link
Member

If we can eliminate the LF requirement that would be ideal but if we cannot it would be nice to keep the workaround scoped to the sample so that the sample is more portable for others that might want to consume it outside of our repo. Barring that working nicely then I'd be OK with the gitattributes change given it shouldn't impact anything else.

@heaths
Copy link
Member Author

heaths commented Jun 22, 2020

Portability is a good concern. I wouldn't expect customers to copy the full sample, but if we were to reorg the sample directory structure it would break, and figuring out why the tests all of a sudden fail wouldn't be very intuitive. I'll consider one of the alternatives.

@heaths heaths merged commit 2fce439 into Azure:master Jun 23, 2020
@heaths heaths deleted the issue12518 branch June 23, 2020 19:22
prmathur-microsoft pushed a commit that referenced this pull request Jul 8, 2020
* Create end-to-end sample for an indexer

Includes AI enrichments. Fixes #12518

* Force line endings

* Resolve PR feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional end-to-end tests
3 participants