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

Extended markdown syntax used in issue-runner #17

Open
eine opened this issue Oct 5, 2020 · 2 comments
Open

Extended markdown syntax used in issue-runner #17

eine opened this issue Oct 5, 2020 · 2 comments

Comments

@eine
Copy link

eine commented Oct 5, 2020

While chatting with @mithro, he mentioned this project and I let him know about issue-runner. As explained in the README, the main purpose of issue-runner is extracting reproducible MWEs from Markdown files. More precisely, from the first comment in GitHub issues. issue-runner extracts source files, (optionally) invokes docker, executed the entrypoint and cleans up. I told Tim about the extended markdown syntax used in issue-runner and he suggested to open this issue for discussion.

issue-runner is composed of two different pieces. There is a golang CLI tool that can process local markdown files, GitHub issue refs or URLs (see https://eine.github.io/issue-runner/#cli). It can process multiple MWEs:

issue-runner 'tests/md/vunit-sh.md' 'VUnit/vunit#337' 'ghdl/ghdl#579'
issue-runner 'ghdl/ghdl#584' 'https://raw.githubusercontent.com/eine/issue-runner/master/tests/md/vunit-py.md'

The CLI tool can be used as a docker container.

As a matter of fact, an ealier iteration of the CLI tool was written in Python: https://github.com/eine/issue-runner/tree/py

On the other hand, there is a TypeScript GitHub Action (https://github.com/eine/issue-runner/tree/master/ts) which can be used in GitHub Action workflows. It is expected to be triggered when issues are opened or edited. It can also be triggered after a tagged release, for checking all open issues in a repo. For instance, this is the summary of analysing ghdl/ghdl: https://github.com/eine/issue-runner/runs/1179157803?check_suite_focus=true#step:8:2839. Ideally, the result of each execution should be reported back in the issue, but this feature is not implemented yet.


The extended Markdown syntax is explained in https://eine.github.io/issue-runner/#supported-markdown-syntax. For code blocks to be considered part of a MWE, :file: needs to be specified. It can be done either in the markdown decoration or as a comment in the language:

```sh :file: hello.sh
#!/usr/bin/env sh
echo "Hello world!"
```
```sh
#!/usr/bin/env sh
echo "Hello world!"
#:file: hello.sh
```

Attached/linked text files and tarballs are also supported. These need :mwe: as a keyword:

[:mwe:filename.ext.txt](URL)
[:mwe:filename.tar.gz](URL)

Then main entrypoint is whichever file named run. Alternatively, a container image can be defined:

```sh :image: debian:buster-slim
echo "Hello world!"
```

NOTE: if the CLI tool is executed as a container and the extraced MWE needs to be executed in a container, the socket needs to be shared for sibling containers to be spawned. See https://eine.github.io/issue-runner/#cli.


According to the README of this repo, tuttest does not support decorated markdown code blocks. Hence, I think it'd be interesting to extend tuttest for supporting issue-runner's syntax. It seems that the usage of name in tuttest is equivalent to file in issue-runner.

@mithro
Copy link

mithro commented Oct 6, 2020

@mgielda - PTAL and tell us what you think? Using a similar syntax for issue-runner and tuttest seems like a potentially good idea?

@mgielda
Copy link
Member

mgielda commented Oct 13, 2020

Thanks for the suggestion. I think going forward we will most likely need to support multiple syntaxes, since there are so many flavors of markdown. So we probably should include your syntax too :)

Interesting project BTW!

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

No branches or pull requests

3 participants