workflowr / workflowr

Organize your project into a research website
https://workflowr.github.io/workflowr
Other
822 stars 106 forks source link

Past versions of html reports #257

Open maskegger opened 3 years ago

maskegger commented 3 years ago

The past versions of html files don't open when publishing to a private gitlab repository. Please see attached screenshot. Opening the past version html link takes me to http://glcdn.githack.com/users/sign_in and gives a "404 Not Found". From the gitlab vignette, I gather this maybe an issue for custom gitlab instances but it is unclear if the same issue applies for private repositories as well. Is this an expected behavior and is there any workaround? Thanks for all the work on the package!

workflowr_versions1

jdblischak commented 3 years ago

@maskegger Thanks for opening the issue!

This behavior is definitely an issue. The past versions of the HTML files are hosted by the public service raw.githack.com. Thus this won't work if your website is private (because it can't access your repo's files).

Ideally workflowr would instead create links to the HTML files on GitLab itself. This is what it does for internally hosted versions of GitHub or GitLab. While the raw HTML isn't as convenient, at least it's not a 404 page.

The problem though is that workflowr would need some way know that the GitHub or GitLab repo was private. Some potential options would be:

  1. Query the GitHub or GitLab API. This would require an API token, so I think this would be more trouble than it's worth
  2. I could make a curl request to the website to see if it accessible or not
  3. I could add a variable to _workflowr.yml that would let users like you with private repos to inform workflowr to not use raw.githack.com
spcanelon commented 3 years ago

Hi @jdblischak! I want to add to this conversation and express that I also would appreciate the ability to explore past versions of html reports while maintaining the repository private.

Past versions of reports is one of the features I'm most looking forward to having through the use of workflowr. In my case it would make meeting updates run much more smoothly and would allow me to make better use of git version control. I often will make small changes to an analysis from one week to another and I'd love to be able to easily compare reports side by side and share them with my manager. The only thing is I do need to keep them private, so having that as possibility would be ideal. Something like Option 3 above would be great!

3. I could add a variable to `_workflowr.yml` that would let users like you with private repos to inform workflowr to not use raw.githack.com
jdblischak commented 2 years ago

Past versions of reports is one of the features I'm most looking forward to having through the use of workflowr. In my case it would make meeting updates run much more smoothly and would allow me to make better use of git version control. I often will make small changes to an analysis from one week to another and I'd love to be able to easily compare reports side by side and share them with my manager.

@spcanelon Exactly! This is one of my favorite use cases for workflowr, so I'm glad you see the potential.

The only thing is I do need to keep them private, so having that as possibility would be ideal. Something like Option 3 above would be great!

Unfortunately I don't think my proposed solution is going to do what you need. If the repo is private (on either GitLab or GitHub), then the HTML files aren't accessible to a public service like raw.githack.com. My proposed solution would instead have the link points to the past version of the raw HTML file, similar to the links for the Rmd files. Thus it wouldn't be easy to browse past versions in a meeting.

Maybe one day I could create and deploy my own service to render both public and private HTML files hosted on GitHub and GitLab. But at this point my web dev skills aren't up for the challenge. Also, I'd be nervous about being responsible for keeping private information truly private.