MicrosoftDocs / azure-devops-server-docs

Documentation for Azure DevOps Server
Creative Commons Attribution 4.0 International
7 stars 11 forks source link

Link to Attachments in 'Code as Wiki' always using default branch #37

Open earloc opened 5 years ago

earloc commented 5 years ago

Related to: https://docs.microsoft.com/en-us/azure/devops/project/wiki/publish-repo-to-wiki?view=azure-devops

I´m transitioning some pages from a provisioned Wiki to a "Code"-Wiki in an on-premise Azure DevOps Server 2019 Installation.

While working on it, I´m using a "feature"-Branch to later leverage a PullRequest in order to let other contributors review the transitioned content, etc..

The Code-Repo currently has a (default) branch 'master', and a non-default feature-branch 'import'

We have a couple of md-files which have links to attachments in it (like DOCX or PDF files). When clicking the links from the published 'import' version, I get a JSON-response stating that the Item could not be found.

{"$id":"1","innerException":null,"message":"TF401174: The item 'path/to/some/document.pdf' could not be found in the repository '[REPONAME]' at the version specified by '<Branch: >' (resolved to commit '[COMMIT-ID])","typeName":"Microsoft.TeamFoundation.Git.Server.GitItemNotFoundException, Microsoft.TeamFoundation.Git.Server","typeKey":"GitItemNotFoundException","errorCode":0,"eventId":3000}

Following the resolved commit-id, I´m seeing the latest commit in the 'master'-branch, rather than the latest (or more correct, the matching) commit of the 'import' branch in relation to the displayed md-file.

Please note that embedded Images are displayed correctly.

Looks like links to non images do not respect the current branch of the published wiki.

Update When I set the 'import'-branch as the default-branch, the file can be found.

Any guidance?

thomps23 commented 5 years ago

@aaronhallberg Could you take a look at this issue and let me know if it belongs here?

mtmossman commented 3 years ago

Currently running into the same issue. Trying to write documentation in the provisioned Wiki with instructional videos and publish it as code after moving the markdown files to the file repo. Each version made in the provisioned Wiki has its own branch in the file repo for versioning/management.

After creating the documentation branch and importing the markdown files is wiki code, the images are found and properly render, but videos and other embedded files are referencing the last commit to the master branch throwing the item not found in repository error you experienced.

@thomps23 were you able to find a more permanent fix or work around other than setting your 'import' branch as the default branch?