Giter Club home page Giter Club logo

Comments (12)

GuangchuangYu avatar GuangchuangYu commented on July 30, 2024 2

merge and will be soon available on cran with v = 0.2.3.

from badger.

wleoncio avatar wleoncio commented on July 30, 2024 1

Sure think, I'll issue the PR right away. As for the CRAN release, we're dependent on the maintainer (@GuangchuangYu).

from badger.

bschilder avatar bschilder commented on July 30, 2024 1

Awesome, thanks @wleoncio !

In the meantime, I'm wrapping a fix around the function when using it within my packages:

gsub("app.codecov.io","codecov.io", ## fix domain name
                         badger::badge_codecov()
                         )

from badger.

fontikar avatar fontikar commented on July 30, 2024 1

Hi folks! Thanks for everyones efforts and investigations! Its been a while since I looked at this but the issue seemed to resolve itself when I just tried it again

Using badger::badge_codecov() and pasting its output in my README seemed to work well: https://github.com/fontikar/ohwhaley

Recently I taught a [R packages workshop ](https://fontikar.github.io/DIY_Rpkg_GHA/#Covering_your_bases_%F0%9F%AA%A4_with_codecov)which involved setting up CodeCov and adding a badge. The participant's badge all initially didn't render, some says unknown, but after granting third party access and waiting a little while, everyone badge was ok?

Sorry I don't have any further issues and can't provide anything reproducible either at this stage so happy for the PR to go ahead!

from badger.

bschilder avatar bschilder commented on July 30, 2024

Been having the same issue myself for a while. Do you know what might be going on here @GuangchuangYu ? Thanks!

from badger.

bschilder avatar bschilder commented on July 30, 2024

Hi @GuangchuangYu @wleoncio @rossellhayes, was wondering if any of you (or any of the other Contributors) could speak to this?

Seems to even be an issue on the README of badger:
Screenshot 2023-01-12 at 13 20 12

from badger.

wleoncio avatar wleoncio commented on July 30, 2024

What happens if you hardcode both ref and branch? Using the example above, I only get a valid output if I specify both:

badger::badge_codecov("rcannood/princurve", branch = "master")
#> [1] "[![](https://app.codecov.io/gh/rcannood/princurve/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rcannood/princurve)"

Created on 2023-01-12 with reprex v2.0.2

from badger.

bschilder avatar bschilder commented on July 30, 2024

Thanks for the reply @wleoncio

Use case 1: princurve

In the case of princurve, I think you get the wrong output with badger::badge_codecov("princurve") because the necessary information can't be pulled from the DESCRIPTION file, and some assumptions are made about the URL (ie omitting the owner's name rcannood). Though leaving ref as the default yield the same result:

out1=badger::badge_codecov("rcannood/princurve", branch = "master")
out2=badger::badge_codecov("rcannood/princurve")

out1==out2
# TRUE

However, when I add the output you generated to a README.Rmd file and try to render it as markdown, it yields a broken link:

Raw markdown text

[![](https://app.codecov.io/gh/rcannood/princurve/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rcannood/princurve)

Markdown rendering

Screenshot 2023-01-12 at 13 58 52

This is odd since navigating to the svg link does indeed show a valid badge:
https://app.codecov.io/gh/rcannood/princurve/branch/master/graph/badge.svg

However, it appears this repo has been deactivated on CodeCov:
https://app.codecov.io/gh/rcannood/princurve

So maybe the issue in this case is the repo being used as example? Though in theory, as long as the badge icon exists, it should still render (it'll just lead to an invalid codecov page).

Use case 2: rworkflows

Let's try with my package instead, rworkflows.
It is currently activated on CodeCov:
https://app.codecov.io/gh/neurogenomics/rworkflows

This yields the wrong link, as it omits the owner name ("neurogenomics"):

badger::badge_codecov(ref="rworkflows")
#  "[![](https://app.codecov.io/gh/rworkflows/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rworkflows)"

This yields the correct link, including the owner name:

badger::badge_codecov()
# "[![](https://app.codecov.io/gh/neurogenomics/rworkflows/branch/master/graph/badge.svg)](https://app.codecov.io/gh/neurogenomics/rworkflows)"

As does specifying the owner/repo explicitly:

badger::badge_codecov(ref="neurogenomics/rworkflows)
#  "[![](https://app.codecov.io/gh/neurogenomics/rworkflows/branch/master/graph/badge.svg)](https://app.codecov.io/gh/neurogenomics/rworkflows)"

The badge icon does indeed exist:
Screenshot 2023-01-12 at 14 10 09

As does the link:
Screenshot 2023-01-12 at 14 10 59

However, just like the princurve output, the badge does not render in markdown.
This also appears to be an issue in html pages, as in my documentation website (notice the broken links in between other badges).
https://neurogenomics.github.io/rworkflows/

Is this a simple markdown syntax issue with the output of badger::badge_codecov? If so, I can't seem to figure it out.

from badger.

wleoncio avatar wleoncio commented on July 30, 2024

Ok, so I took a look at another repo of mine where the badge works. I don't remember how I figure this out, but dropping app. from the URL works, i.e.:

[![](https://codecov.io/gh/rcannood/princurve/branch/master/graph/badge.svg)](https://codecov.io/gh/rcannood/princurve)

yields

Doing the same for your repo also seems to work:

[![](https://codecov.io/gh/neurogenomics/rworkflows/branch/master/graph/badge.svg)](https://codecov.io/gh/neurogenomics/rworkflows)

outputs

from badger.

bschilder avatar bschilder commented on July 30, 2024

Ah, excellent! Thanks so much for this @wleoncio

So it seems this is just a matter of badger updating the CodeCov domain name. Would you (or one of the other developers) possibly be able to make a push to GitHub and CRAN adding this?

from badger.

wleoncio avatar wleoncio commented on July 30, 2024

@fontikar, can you confirm that the proposal on PR #46 would solve this issue?

from badger.

wleoncio avatar wleoncio commented on July 30, 2024

That's perfectly fine, thanks for the input! Fingers crossed the fix gets merged and published soon. :)

from badger.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.