Skip to content

Commit

Permalink
Merge pull request #44 from Openscapes/jun-25-dry-run
Browse files Browse the repository at this point in the history
in progress
  • Loading branch information
stefaniebutland authored Jun 25, 2024
2 parents 82c09f8 + 0687359 commit db6bf73
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 33 deletions.
12 changes: 0 additions & 12 deletions demo.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ Additional attributes like image size, alt text, and linking the image to a URL,

![The Openscapes logo](/images/openscapes_hex.png){fig-alt="Openscapes logo. A hexagonal shape with orange border, yellow background, the word openscapes in orange above a cartoon evoking a landscape of data plots" width="35%"}

#### Code

When you **Render**, a document will be generated that includes both content and the output of embedded code. You can embed code like this:

*TODO: day before clinic, make this Python code (don't add screenshot - fewer files to for folks to get distracted with, lighter weight repo)*

```{r}
2 * 2
```

You can add options to executable code. The `echo: false` option disables the printing of code (only output is displayed).

## Stefanie

For your first edit, you could fix this tpyo and preview how it will look in the site.
Expand Down
Binary file added images/pull-request.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 67 additions & 21 deletions part2-github.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@ title: "Part 2: GitHub workflow"

## Contribute your updates using GitHub

Now that we have each saved some changes to files in our Quarto site source, liike `.qmd`, `.ipynb`, and/or `_quarto.yml`, we can contribute our updates using GitHub.
Now that we have each saved some changes to files in our Quarto site source, we can contribute our updates using GitHub.

### Demonstration
We will demonstrate this and then you will do this in breakout rooms.

### Author stages, commits, and pushes file

You have to deliberately tell Git/GitHub when you have work that you want to be versioned and synced. First, inspect the differences your edits will introduce.

![](images/jupyterhub-git-diff.png){fig-align="center" width="100%"}
![](images/jupyterhub-git-diff.png){fig-align="center" width="80%"}

In the Git tab "stage" your saved changes.
In the Git tab "stage" your saved changes. There may be a `.json` file that you also stage; this is part of the Quarto build process.

![Stage your changes](images/jupyterhub-git-stage.png){fig-align="center" width="50%"}

Commit your edits with a good commit message and push your edits to GitHub. A commit message is a human-readable message, like leaving a breadcrumb trail for your future self and others.

![Commit and Push](images/jupyterhub-git-commit-push.png){fig-align="center" width="50%"}
![Commit and Push](images/jupyterhub-git-commit-push.png){fig-align="center" width="50%"} When you **push** by clicking the push icon (with the orange dot since we have committed files to push), you may be prompted to enter your git credentials.

### Set up our Git credentials
### Aside: set up our Git credentials

On your first commit, you will be prompted to add your Git credentials. When you are working on a project over time, you can have them stored, following instructions in [Configure Git (git config)](https://nasa-openscapes.github.io/2021-Cloud-Hackathon/tutorials/00_Setup.html#step-5.1.-configure-git-git-config) from the 2021 Cloud Hackathon.

Expand All @@ -46,34 +48,38 @@ When you see the following screenshot, GitHub is asking for you to input your cr

We'll follow the instructions in the 2021 Cloud Hackathon to [Setup your Personal Access Token (PAT)](https://nasa-openscapes.github.io/2021-Cloud-Hackathon/tutorials/00_Setup.html#step-5.6.-setup-pat).

### Make a Pull Request
### Author makes a Pull Request

Our current status is that in the Hub, in our own branch of the Quarto Clinic repo, we have made one or more edits to the Clinic files, committed those updates, and pushed those commit(s) to GitHub. How do our suggested contributions get incorporated into the main Quarto Clinic repo and website? Via a **Pull Request**.

After pushing your edits, go to <https://github.com/Openscapes/quarto-clinic/> <!--- replace with unique link to a clinic ---> and you will see a yellow banner inviting you to make a Pull Request to add your edits to the Clinic repo.
Now we'll go to <https://github.com/Openscapes/quarto-clinic/> <!--- replace with unique link to a clinic ---> and you will see a yellow banner inviting you to make a Pull Request to add your edits to the Clinic repo.

![](images/github-yellow-pr-banner.png){fig-align="left" width="90%"}

Not finished proposing your updates? You can set your Pull Request as a Draft at the start so folks can see your thinking. Set Ready for Review when ready and request a reviewer(s). For the NASA Earthdata Cloud Cookbook, any Pull Request must be reviewed before it can be merged. If you know someone who is familiar with the content you're proposing to add, request their review.

### Review a pull request
![First view of a Pull Request.](images/pull-request.png){fig-align="center" width="90%"}

### Reviewer reviews the Pull Request

TODO:

From the pull request page in GitHub browser, look at the elements of the pull request.

<!--- *TODO: add screenshot of a PR page like the one in Cookbook, pull-request-example.png* --->

- Start with Conversation tab:
- Start with **Conversation** tab:
- We can see all commits and comments on what Andy has worked on
- This is where we can add PR reviewers by clicking the gear icon next to "Reviewers" at the top right corner of this tab.
- Commit tab:
- **Commit** tab:
- More details on the commits that we saw under Conversation. When we click on one of the commits, we can see line by line what has changed under that commit (green lines are added, red lines have been removed)
- Files Changed tab:
- **Files Changed** tab:
- View all the files that changed across the commits
- In Nav bar: Orange dot box signifies modified; Green plus box means something's been added; Red minus box means deleted; Grey arrow box means renamed.
- Checks tab:
- **Checks** tab:
- Shows status of the Github Action that renders and deploys the site. We can know whether this Pull Request is able to be deployed.

Now, switch to the 2i2c Hub to view the Cookbook preview as it would appear if the pull request was merged:
Now, switch to the 2i2c Hub to view the Clinic preview as it would appear if the pull request was merged:

- Terminal:
- Go to the Main branch and pull so that we have the most recent changes from remote.
Expand All @@ -89,20 +95,60 @@ Review each individual file that has changed and come back to the main `_quarto.

Once our review is complete, we add a note in the GitHub review box and click "Approve", "Comment" or "Request changes". In the note it can be really helpful to add a note of appreciation for some aspect of the contribution, tagging the author, saying they can merge the PR after making changes, and possibly add a summary of our requested edits including the number of changes requested. Some changes in the middle of a long list of edits can be marked as hidden conversations, so this can be helpful to the author to know they've seen everything.

### Merge your Pull Request
### Author merges Pull Request

As the author, you can now address the reviewer's comments and then merge your Pull Request.

### Try it out!
## Your turn - Breakout rooms

Pair up in breakouts to make and review each other's Pull Requests

## View your updates in the live site (Regroup, 10 min)
We've done this demonstration - now you'll go into breakout rooms. One of you be the Author role, and one the Reviewer role, with each of you screensharing where you are playing your role. Help each other out! If there is time, please switch roles

Steps:

- Author stages, commits, and pushes file
- Author makes a Pull Request
- Reviewer reviews the Pull Request
- Author merges Pull Request
- Make notes of any questions you have, challenges

## Regroup & Wrap up

### Review our updated site

<https://openscapes.github.io/quarto-clinic/demo>

### Tidying up

Good practices to tidy your workspace & save unneccessary storage costs:

From GitHub Browser:
- **Delete branch on GitHub Browser**

From JupyterHub:
- **Delete `stefanie` branch** from the Git plugin
- **Delete quarto-clinic folder** from terminal `cd ..` then `rm -rf quarto clinic`
- **Shut down Hub** from File menu

## Regroup discussion topics

**Short message: commit the freeze folder.**
### Deleting branches

### Code & rendering `.qmd` files

You can add code TODO

When you **Render**, a document will be generated that includes both content and the output of embedded code. You can embed code like this:

*TODO: day before clinic, make this Python code (don't add screenshot - fewer files to for folks to get distracted with, lighter weight repo)*

You can add options to executable code. The `echo: false` option disables the printing of code (only output is displayed).

### Freeze

**Commit the freeze folder.**

- Freeze directory contains the results of code execution.
- Commit the freeze directory after you run quarto preview.
- If there are merge conflicts when you submit to NASA Openscapes Cookbook, maintainers will help resolve them.
- Freeze directory contains the results of code execution.
- Commit the freeze directory after you run quarto preview.
- If there are merge conflicts when you submit to NASA Openscapes Cookbook, maintainers will help resolve them.

0 comments on commit db6bf73

Please sign in to comment.