Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize variables stored during CI builds #130

Closed
agitter opened this issue Aug 4, 2019 · 2 comments · Fixed by #131
Closed

Generalize variables stored during CI builds #130

agitter opened this issue Aug 4, 2019 · 2 comments · Fixed by #131

Comments

@agitter
Copy link
Member

agitter commented Aug 4, 2019

Currently, Manubot stores the repository and commit metadata when it is run on Travis CI:

# Set repository version metadata for Travis CI builds only
# https://docs.travis-ci.com/user/environment-variables/
if os.getenv('TRAVIS', 'false') == 'true':
repo_slug = os.environ['TRAVIS_REPO_SLUG']
repo_owner, repo_name = repo_slug.split('/')
variables['ci_source'] = {
'repo_slug': repo_slug,
'repo_owner': repo_owner,
'repo_name': repo_name,
'commit': os.environ['TRAVIS_COMMIT'],
}

Per manubot/rootstock#198 (comment) we would like to generalize this to store similar metadata for other continuous integration services. AppVeyor is of immediate interest because it will be used for pull request build previews in manubot/rootstock#262.

AppVeyor's environment variables are listed at https://www.appveyor.com/docs/environment-variables/. We likely want:

  • APPVEYOR
  • APPVEYOR_PROJECT_SLUG
  • APPVEYOR_REPO_COMMIT

We could also store which CI service was used in a new variable. When updating manubot/rootstock, we'll also need to update the front matter permalink, which is only relevant for Travis CI.

@dhimmel
Copy link
Member

dhimmel commented Aug 4, 2019

I will work on the implementation of this

we'll also need to update the front matter permalink, which is only relevant for Travis CI.

Currently, 00.front-matter.md contains:

{% if ci_source is defined -%}
([permalink](https://{{ci_source.repo_owner}}.github.io/{{ci_source.repo_name}}/v/{{ci_source.commit}}/))
{% endif -%}

So do we want to omit the permalink altogether for AppVeyor builds or do we want to give the artifact link?

@agitter
Copy link
Member Author

agitter commented Aug 4, 2019

I hadn't thought about giving the artifact link. I like that idea. The artifacts aren't permanent though, so it would be a slight abuse of terminology to call it a permalink (even though AppVeyor does in their webhook doc).

I'm also okay discarding the link completely if that's easier. Or adding a new ci_source.deploy flag to indicate whether we want to display the link.

dhimmel added a commit to agitter/manubot-rootstock that referenced this issue Aug 6, 2019
dhimmel added a commit that referenced this issue Aug 9, 2019
Merges #131
Closes #130

Create the manubot.process.ci submodule for functionality for detecting
whether manubot is running in a continuous integration environment.
This lays the groundwork for supporting multiple CI providers for Manubot
builds.

Update Manubot software paper with PMCID.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants