Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Invalid build url generated for appveyor when account name is not same as repository account #81

Closed
skwasjer opened this issue Jul 28, 2019 · 10 comments
Milestone

Comments

@skwasjer
Copy link

skwasjer commented Jul 28, 2019

I am running into an issue where codecov links to a CI build url with incorrect slug:

For example:
https://codecov.io/gh/skwasjer/Rebus.Correlate/commit/ab9ca67ee25f9c927ba8b474c2091fda10ac6178/builds

On this page the uploaded codecov report 5crrqoxx7dlc2awa points to the AppVeyor build URI https://ci.appveyor.com/project/skwasjer/Rebus.Correlate/build/job/5crrqoxx7dlc2awa

However the Rebus.Correlate portion in this URI should be the AppVeyor slug rebus-correlate, then it works.

In https://github.com/codecov/codecov-exe/blob/master/Source/Codecov/Services/ContinuousIntegrationServers/Appveyor.cs#L14

private readonly Lazy<string> _slug = new Lazy<string>(() => EnviornmentVariable.GetEnviornmentVariable("APPVEYOR_REPO_NAME"));

should this not be APPVEYOR_PROJECT_SLUG?

@AdmiringWorm
Copy link
Collaborator

should this not be APPVEYOR_PROJECT_SLUG?

Unfortunately no, that variable is for the repository itself in the format of repositoryOwner/repositoryName.

The actual code for detecting the appveyor build slug is done here:
https://github.com/codecov/codecov-exe/blob/master/Source/Codecov/Services/ContinuousIntegrationServers/Appveyor.cs#L40-L51

Which I also see on you build that it gets picked correctly, which is shown in the job query value on the url skwasjer%2Frebus-correlate%2F1.0.9.13.

From what I can see on your build, everything is correctly set in the url used to ping codecov.

@stevepeak Are you able to share some light of why the link to the appveyor build uses an incorrect appveyor build slug?

@skwasjer
Copy link
Author

skwasjer commented Jul 28, 2019

Gotcha. I've used the same config in two other projects, and they work fine - be it that they have a simpler project name.

Just for extra info, reason I went digging a little is because none of the reports worked, only this specific commit I did a local upload.

F.ex. the commit afterwards did not even get linked to a CI build, and jsut reports an error:

https://codecov.io/gh/skwasjer/Rebus.Correlate/commit/8a9c30efc5a388709a7a276c6d0ac491cb5d434d

[edit] I just noticed coverage did not collect any results :|
I'll go fix that first I suppose and reopen if needed.

No results, this could be for a number of reasons. The most common reasons are:
    1) missing PDBs for the assemblies that match the filter please review the
    output file and refer to the Usage guide (Usage.rtf) about filters.
    2) the profiler may not be registered correctly, please refer to the Usage
    guide and the -register switch

@skwasjer
Copy link
Author

skwasjer commented Jul 28, 2019

So yea, forgot one tiny detail ^^

skwasjer/Rebus.Correlate@4734a73

However, the build link still is not working.

@skwasjer skwasjer reopened this Jul 28, 2019
@AdmiringWorm
Copy link
Collaborator

I have been trying to figure out why the build url is incorrect.
Even falling back to comparing the code with the official bash uploader, is there should be no difference between them with the query parameters specified.

As such, I do believe this is an issue on the server itself, and that would mean you would need to use the official support contact information on the website to get the incorrect build url resolved.

I only manage this program, which is only a community provided tool and not a true officially supported one (only supported by me and the rest of the community).

@skwasjer
Copy link
Author

@AdmiringWorm thanks for the time troubleshooting, I will sent a ticket to the support address

@AdmiringWorm
Copy link
Collaborator

Let us keep this issue open. At least until you have gotten a response from the codecov.io support team.

@AdmiringWorm AdmiringWorm reopened this Jul 28, 2019
@AdmiringWorm
Copy link
Collaborator

I believe I have found a way for the build url to be fixed during upload.

While I do still believe this is an upstream issue, I will look into submitting the correct url during upload to the servers.

I just need to figure how to build said url.

@AdmiringWorm
Copy link
Collaborator

Temporarily you can try setting the CI_BUILD_URL environment variable to the full url of the build. At least until I can figure out how to build the url correctly on appveyor (Trying to find a way to not rely on a hardcoded value of https://ci.appveyor.com).

The format for the mentioned should be similar to the following:

powershell

$env:CI_BUILD_URL = "https://ci.appveyor.com/project/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/build/job/$env:APPVEYOR_JOB_ID"

sh

export CI_BUILD_URL="https://ci.appveyor.com/project/$APPVEYOR_ACCOUNT_NAME/$APPVEYOR_PROJECT_SLUG/build/job/$APPVEYOR_JOB_ID"

@AdmiringWorm
Copy link
Collaborator

Thanks to the awesome folks over at AppVeyor I now know what I can use to build the url correctly.
I will update the application with the build url and push out a new release when I get home later today.

@AdmiringWorm AdmiringWorm added this to the 1.7.2 milestone Aug 15, 2019
@AdmiringWorm AdmiringWorm changed the title Invalid build url Invalid build url generated on appveyor Aug 15, 2019
AdmiringWorm added a commit that referenced this issue Aug 15, 2019
* bugfix/appveyor-build-url:
  Revert "(build) Disabled ubuntu build on appveyor temporarily"
  (build) Disabled ubuntu build on appveyor temporarily
  Revert "(build) Output the project slug from appveyor"
  Revert "(build) Testing setting build url enviroment variable"
  (build) Clear variable used during unit tests
  (build) added bugfix branches as valid branch on travis
  (GH-81) Fixed build url not being passed to codecov.io
  (build) Testing setting build url enviroment variable
  (build) Removed manual exit after environment variable output
  (build) Output the project slug from appveyor
@AdmiringWorm AdmiringWorm changed the title Invalid build url generated on appveyor Invalid build url generated on appveyor when account name is not same as repository account Aug 15, 2019
@AdmiringWorm AdmiringWorm changed the title Invalid build url generated on appveyor when account name is not same as repository account Invalid build url generated for appveyor when account name is not same as repository account Aug 15, 2019
AdmiringWorm added a commit that referenced this issue Aug 16, 2019
* hotfix/1.7.2:
  (GH-87) Added missing tag aquiral on travis ci
  (GH-86) Added generation of build url to travis parser
  Revert "(build) Disabled ubuntu build on appveyor temporarily"
  (build) Disabled ubuntu build on appveyor temporarily
  Revert "(build) Output the project slug from appveyor"
  Revert "(build) Testing setting build url enviroment variable"
  (build) Clear variable used during unit tests
  (build) added bugfix branches as valid branch on travis
  (GH-81) Fixed build url not being passed to codecov.io
  (build) Testing setting build url enviroment variable
  (build) Removed manual exit after environment variable output
  (build) Output the project slug from appveyor
@AdmiringWorm
Copy link
Collaborator

Version 1.7.2 is now available on nuget (and chocolatey). This build includes the fixes so the url on codecov.io should be correct now if you submit reports with the new version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants