Comments (6)
One thing that comes to mind would be the following:
Instead of creating a PAT, base64 encode that with :
in front of it and passing that to the reportgenerator task,
why not do the same, but use the predefined $(System.AccessToken) variable?
from reportgenerator.
Updated my OP
Adding the custom settings with the header does solve the errors about not being able to access the file, however when I look at the report, I still see HTML code for the Azure DevOps signin page.
I also went ahead and tried the following combinations:
- Use
Authorization=Bearer $(System.AccessToken)
This also got rid of the errors, but still the same issue with the HTML being shown - Use
Authorization=Basic $(System.AccessToken)
Same result as above, weirdly. I'd expect a error here about not being able to authorize - Added a powershell task right before the reportgenetor one, which would base64 encode my PAT (stored in Library group) and then publish the encoded value as a variable, which i'd then use in the reportgenerator task.
from reportgenerator.
Just found #574, which is exactly what I'm experiencing but there the custom header thing solved it
from reportgenerator.
Just had a look at the XML of the coverage.cobertura.xml file on the build server.
This is such a class element:
<class name="MyFile" filename="https://dev.azure.com/<org>/<project>/_apis/git/repositories/<repo>/items?api-version=1.0&versionType=commit&version=cd08f3ea70b6f2af6759105e6354412912f4607a&path=/path/to/MyFile.cs" line-rate="0" branch-rate="1" complexity="1">
<methods>
<method name="Slice" signature="(T[],System.Int32,System.Int32)" line-rate="0" branch-rate="1" complexity="1">
<lines>
<line number="9" hits="0" branch="false"/>
<line number="10" hits="0" branch="false"/>
<line number="11" hits="0" branch="false"/>
</lines>
</method>
</methods>
<lines>
<line number="9" hits="0" branch="false"/>
<line number="10" hits="0" branch="false"/>
<line number="11" hits="0" branch="false"/>
</lines>
</class>
When I manually visit the URL, I expected the file to be shown.
Instead, I got a JSON response:
{
"count": 1,
"value": [
{
"objectId": "ff0f119466f3a659fccfbc3c55da2a7f010d688f",
"gitObjectType": "tree",
"commitId": "437a707e7c785092f2bc86876e60a4ba3d6f5c61",
"path": "/",
"isFolder": true,
"url": "https://dev.azure.com/<org>/e02f8955-9af5-4c0b-b176-6d84d4bf262f/_apis/git/repositories/5b4d0245-81fb-49de-b9fd-c3a6c29010da/items?path=%2F&versionType=Branch&versionOptions=None"
}
]
}
Replaced sensitive data with placeholders in the URLs ofcourse
from reportgenerator.
If I however manually fix the URL from
https://dev.azure.com/<org>/<proj>/_apis/git/repositories/<repo>/items?api-version=1.0&versionType=commit&version=cd08f3ea70b6f2af6759105e6354412912f4607a&path=/Path/To/MyFile.cs
to
https://dev.azure.com/<org>/<proj>/_apis/git/repositories/<repo>/items?api-version=1.0&versionType=commit&version=cd08f3ea70b6f2af6759105e6354412912f4607a&path=/Path/To/MyFile.cs
I do get back the file contents.
So this might be an issue in coverlet / coberatura then?
from reportgenerator.
After going through this file:
I'd figured I give clearing that cache folder a go.
And it seems to be working correctly now, so I'll go ahead and close this for now.
My build pipelines heavily relies on templates from another repository, in which I was making most changes. So that's probably why it would grab the cached items, because the commit hash of the actual repo being built hadn't changed.
from reportgenerator.
Related Issues (20)
- minimumCoverageThresholds:lineCoverage not working HOT 12
- Issue with -reporttypes field HOT 1
- Wiki Edit HOT 1
- Unable to convert opencoverxml file into corbertura.xml file using ReportGenerator in Azure Devops Pipeline HOT 3
- Release notice confuses me. HOT 1
- Why is the reportgenerator command installed using the dotent not working? HOT 2
- Report generated is always at version 5.1.14.0 on AzureDevops HOT 1
- Allow to specify the root path HOT 1
- Question: Is the format created by the CTC++ tool supported as input for report generator? HOT 2
- MS Coverage output isn't cleaning compiler generated methods/types HOT 8
- Ability to exclude classes from Risk Hotspots HOT 6
- Error while converting jacoco report to cobertura HOT 12
- Suggestion for new report type: MarkdownTableShortSummary HOT 2
- Sonarqube format clashes with DeterministicSourcePaths=true HOT 5
- Azure DevOps task option publishCodeCoverageResults doesn't work with relative targetdir path HOT 2
- Azure pipeline failure due to dependency on NodeJS version 6 HOT 3
- Docs/readmes: add info about `minimumCoverageThresholds` HOT 2
- ReportGenerator 5.3.1 fails on self hosted azure devops agent running on Amazon Linux 2 arm64 instance (t4g) HOT 2
- Question about lcov conversion HOT 4
- Strange source file references in a HTML report from dotnet-coverage on Linux
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reportgenerator.