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

Add codespace container for reproducing issues #3537

Merged
merged 8 commits into from
Jan 8, 2024

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Jan 1, 2024

Tasks finished to resolve #2753 (#3536 is messed up):

  • Added a codespace container configuration file.
  • Added a brief guide to use codespace container for issue reproduction.
  • Added link in issue template to encourage users to try this new workspace.

However I still need advice on handling user feedbacks, as I failed to identify any way to create a link or share a snapshot to an existing codespace, as @janosh suggested.

We'd link this codespace in our issue template and invite people to launch it, copy-paste their code into it and then paste the link to the codespace into their issue.

The closest I could find currently is the Live Share, which allows multiple users to work on a single codespace in real-time. But I don't think this is what we're looking for though. This would require the user to publicly share a link to a codespace and might have security risks.

So far the best solution to me still remains to run the code in the codespace, and paste the output back to the issue manually (until a feature such as sharing a codespace snapshot is out). In doing so, we could help pre-configure the reproduction environment and information collection mechanisms, also avoiding all sorts of non-pymatgen issues (python not installed properly, outdated pymatgen or dependency, and so on).

@DanielYang59
Copy link
Contributor Author

DanielYang59 commented Jan 1, 2024

Also to answer your @janosh question in #3536 that:

Shouldn't this markdown be part of the issue template?

My idea is to keep the issue template clean (and it is not a tutorial at the end of the day), and make codespace optional (instead of "pushing" codespace to users).

However it occurs to me that it might be better to move the guidance figure into the issue template, and put the introductory stuff into the repro template (if the use follows the figure and open up the codespace, the repro template would be presented)? In doing this we could avoid an extra readme file. What do you think?

Again I'm really sorry for messing around with the commit history. But after one hour's experiment I'm now much more confident with git workflow (Just realize could rewrite commit history so reopen a PR is not necessary). Thanks.

add repro template

add codespace guide

include link to guide in issue template
@janosh
Copy link
Member

janosh commented Jan 7, 2024

In doing this we could avoid an extra readme file. What do you think?

yes exactly, i think avoiding an extra readme file which many people might miss would be nice. could you make that change?

@DanielYang59
Copy link
Contributor Author

DanielYang59 commented Jan 7, 2024

Done @janosh. I merged the separate guide README.md into the issue template (folded by default to minimize disturbance to the template overall). Let me know if you would like to see more changes.

Comment on lines 9 to 16
<details>
<summary>🚀 Click to Show the Codespaces Guide</summary>
<img width="300" alt="Create codespace" src="https://github.com/materialsproject/pymatgen/assets/80093591/482181f8-d7e1-49b4-8382-2d948ed4e550">

1. Open up the [pymatgen repo](https://github.com/materialsproject/pymatgen) in your web browser.
2. Click the green `Code` button at the top-right corner of the repo, and switch to the `Codespaces` panel.
3. Click `Create code space on master` to create a new codespace, or to return to an existing codespace.
</details>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than this multistep process, can we not just show an SVG badge with a deeplink to open a new codespace? see Open in GitHub Codespaces docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janosh Wonderful suggestion! Thanks and implemented.

@DanielYang59 DanielYang59 requested a review from janosh January 8, 2024 05:09
Copy link
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DanielYang59! In devcontainer.json, I decreased hostRequirements.cpus: 4->1 since Python only uses 1 CPU anyway. Unless I'm missing something?

@janosh janosh merged commit e6e818d into materialsproject:master Jan 8, 2024
22 checks passed
@DanielYang59
Copy link
Contributor Author

@janosh Look good to me. Good work @janosh. 1 core should suffice.

@DanielYang59
Copy link
Contributor Author

DanielYang59 commented Jan 9, 2024

@janosh It seems you might have left the outputs inside the repro template ipynb?

date: 2024-01-08
Python version: 3.11.6
pymatgen version: 2023.11.12
pymatgen version: 2023.11.12

Also the Now share the code and outputs in a [new GitHub issue] seems to point to an empty issue template. Can you please replace the url with https://github.com/materialsproject/pymatgen/issues/new?assignees=&labels=bug&projects=&template=bug_report.yaml?

I wouldn't create a PR just for this on my side. Thanks!

janosh added a commit that referenced this pull request Jan 9, 2024
… by adding &labels=bug&template=bug_report.yaml

as suggested in #3537 (comment)
@janosh
Copy link
Member

janosh commented Jan 9, 2024

Thanks @DanielYang59, good catch! 👍

DanielYang59 pushed a commit to DanielYang59/pymatgen that referenced this pull request Jan 10, 2024
@janosh janosh added contributing Issues about how to contribute, report errors, submit features dx Developer experience labels Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributing Issues about how to contribute, report errors, submit features dx Developer experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repro template
2 participants