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

Mention need to adjust source URL in config.yaml #199

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions learners/migrating-from-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
**_We strongly recommend that you create a backup of your lesson repository before you follow this workflow._**
:::

:::::::: prereqs

Check warning on line 17 in learners/migrating-from-styles.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[unknown div] prereqs

## Prerequisites

Expand All @@ -32,11 +32,11 @@

## Transition Workflow

1. [Set up the transition tools](#workflow-setup)

Check warning on line 35 in learners/migrating-from-styles.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing anchor]: [Set up the transition tools](#workflow-setup)
2. [Create an Rscript for your lesson](#Rscript)

Check warning on line 36 in learners/migrating-from-styles.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing anchor]: [Create an Rscript for your lesson](#Rscript)
3. [Run the transition tool](#transition)

Check warning on line 37 in learners/migrating-from-styles.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing anchor]: [Run the transition tool](#transition)
4. [Set up your GitHub repository to receive the transitioned lesson](#github)

Check warning on line 38 in learners/migrating-from-styles.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing anchor]: [Set up your GitHub repository to receive the transitioned lesson](#github)
5. [Post-transition steps](#post-transition)

Check warning on line 39 in learners/migrating-from-styles.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing anchor]: [Post-transition steps](#post-transition)

::: callout
Note: these steps assume your lesson exists in The Carpentries Incubator i.e. under the `carpentries-incubator` organisation on GitHub. If it does not, you will need to replace all of the folder names etc below accordingly.
Expand Down Expand Up @@ -88,7 +88,7 @@
bash add-lesson.sh carpentries-incubator/YOUR-LESSON-NAME
```

But you may wish to populate this script with some function calls to clean up various common artifacts produced by the transition, or to preserve any [custom workflows](#custom-workflows) you have added to your lesson repository. Look at the `.R` scripts in the [`carpentries-incubator/`](https://github.com/carpentries/lesson-transition/tree/main/carpentries-incubator), [`datacarpentry`](https://github.com/carpentries/lesson-transition/tree/main/datacarpentry), [`librarycarpentry`](https://github.com/carpentries/lesson-transition/tree/main/librarycarpentry), and [`swcarpentry`](https://github.com/carpentries/lesson-transition/tree/main/swcarpentry) directories of the `lesson-transition` repository for inspiration.

Check warning on line 91 in learners/migrating-from-styles.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing anchor]: [custom workflows](#custom-workflows)

### 3. Run the transition tool{#transition}

Expand Down Expand Up @@ -150,7 +150,7 @@
To check how things are looking, [install the Workbench tools for your system](index.html#installation), then open R in this directory and run `sandpaper::serve()`.

#### Optional: update your lesson's R script to produce a smoother transition
While previewing this transitioned lesson site, you might see some problems in the content of your lesson site that appeared during the migration. Liquid comments (delineated by `{% comment %}` and `{% endcomment %}` tags) are one commonly-encountered artifact. Another is broken links to the lesson setup instructions, which are found at `index.html#setup` in a Workbench site. These can be fixed by editing the lesson after transition, but for a cleaner commit history on your lesson you might wish to delete the transitioned lesson directory (inside the `release` folder), modify the R script for your lesson to handle those issues, and re-run the transition tool. (See [_Create an Rscript for your lesson_](#Rscript) above.)

Check warning on line 153 in learners/migrating-from-styles.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing anchor]: [Create an Rscript for your lesson](#Rscript)

#### If something goes wrong
To go back to the start and try again, delete the directory for your lesson within the `release/` directory, i.e. `rm -rf release/carpentries-incubator/YOUR-LESSON-NAME`.
Expand All @@ -166,19 +166,21 @@
**We recommend that you try these steps out on a fork of your lesson first**, so that you can be certain everything works before making permanent changes to your main lesson repository.
:::

1. Record your lesson creation date in config.yaml: run `git log` and hit <kbd>Shift+G</kbd> to jump to end of file, note down the date when the first commit was made. Then, using your favourite text editor, open `config.yaml` and modify the `created` field by replacing `~` with this creation date in YYYY-MM-DD format.
1. Adjust the `config.yaml`:
- Record your lesson creation date in config.yaml: run `git log` and hit <kbd>Shift+G</kbd> to jump to end of file, note down the date when the first commit was made. Then, using your favourite text editor, open `config.yaml` and modify the `created` field by replacing `~` with this creation date in YYYY-MM-DD format.
- Check the `source` URL specified in `config.yaml`: this may be set incorrectly during the transition process. Adjust it to the correct URL for your lesson source repository on GitHub.

2. Commit the changes you made to the lesson config file:
3. Commit the changes you made to the lesson config file:

```bash
git add config.yaml
git commit -m 'complete configuration of Workbench lesson site'
```

3. Rename the branches of your project:
4. Rename the branches of your project:
- On your GitHub repository, rename the `gh-pages` branch to `legacy/gh-pages` (if `main` is your default branch, also rename that to `legacy/main`).
- Branches can be renamed by going to the list of all branches on your repository (add `/branches/all` to the end of the URL for your GitHub repository e.g. <https://github.com/datacarpentry/image-processing/branches/all>) and selecting the pencil icon button next to the relevant branch in that listing.
4. In Bash on your local system (make sure you are working in the root of the `release/carpentries-incubator/YOUR-LESSON-NAME` directory), run the following commands (please read the comments that annotate these commands and note that **we strongly recommend that you execute these one-at-a-time!**):
5. In Bash on your local system (make sure you are working in the root of the `release/carpentries-incubator/YOUR-LESSON-NAME` directory), run the following commands (please read the comments that annotate these commands and note that **we strongly recommend that you execute these one-at-a-time!**):

```bash
git remote -v # check the names and addresses of your remote repositories: if you are testing on a fork and it is not listed here, add it with 'git remote add' https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emaddem
Expand All @@ -193,14 +195,14 @@
git push --force origin HEAD:gh-pages
```

5. If everything has gone well up to this point, it is time to go back to the `main` branch and force push its contents to GitHub:
6. If everything has gone well up to this point, it is time to go back to the `main` branch and force push its contents to GitHub:

```bash
git switch main
git push --force --set-upstream origin main # force push the transitioned main branch to your GitHub repository
```

6. On your GitHub repository:
7. On your GitHub repository:
- set the default branch to `main` (in Settings->General, click the button with two arrows next to the name of the default branch)
- in Settings->Branches, add rules to protect the `main` branch (require pull requests) and lock `legacy/*`
- make sure that your lesson site is being served with GitHub Pages from the root folder of the gh-pages branch (in Settings->Pages, under _Build and deployment_, ensure that `gh-pages` is selected with the dropdown under _Branch_ and that `/ (root)` is the folder selected, then hit the _Save_ button)
Expand Down
Loading