diff --git a/.github/workflows/build-mkdocs-website.yml b/.github/workflows/build-mkdocs-website.yml index 0e4bae9bb..3dc3e2447 100644 --- a/.github/workflows/build-mkdocs-website.yml +++ b/.github/workflows/build-mkdocs-website.yml @@ -1,11 +1,7 @@ -name: Build MkDocs website +name: Build MKDocs website on: workflow_dispatch: - push: - branches: ["main","devel"] - paths: - - '.github/workflows/build-mkdocs-website.yml' pull_request: branches: ["main","devel"] types: [closed] @@ -18,28 +14,14 @@ jobs: build-and-deploy: if: | github.event_name == 'workflow_dispatch' || - github.event_name == 'push' || - (github.event_name == 'pull_request' && - github.event.pull_request.merged == true) + (github.event_name == 'pull_request' && github.event.pull_request.merged == true) runs-on: ubuntu-latest permissions: contents: write steps: - - name: Validate PAT - env: - GH_PAT: ${{ secrets.R_DEV_ENV_DOCS }} - run: | - curl -H "Authorization: token $GH_PAT" \ - https://api.github.com/user || { - echo "PAT is invalid or expired" >&2 - exit 1 - } - - name: Checkout repository uses: actions/checkout@v4 - with: - token: ${{ secrets.R_DEV_ENV_DOCS }} - name: Set up Python uses: actions/setup-python@v5 @@ -49,36 +31,41 @@ jobs: - name: Install dependencies run: pip install mkdocs mkdocs-material[imaging] - - name: Determine target repo + - name: Determine deployment settings id: config run: | if [[ "${{ github.ref_name }}" == "main" ]]; then - echo "repo=${{ github.repository }}" >> "$GITHUB_OUTPUT" + echo "target_repo=${{ github.repository }}" >> "$GITHUB_OUTPUT" + echo "url=https://contributor.r-project.org/r-dev-env" >> "$GITHUB_OUTPUT" else - echo "repo=${{ github.repository }}-devel" >> "$GITHUB_OUTPUT" + echo "target_repo=r-devel/r-dev-env-devel" >> "$GITHUB_OUTPUT" + echo "url=https://contributor.r-project.org/r-dev-env-devel" >> "$GITHUB_OUTPUT" fi - - name: Modify site_url for development documentation + - name: Modify site_url in mkdocs.yml run: | - if [[ "${{ github.ref_name }}" != "main" ]]; then - site_url=https://contributor.r-project.org/r-dev-env-devel - echo "Setting site_url to '${site_url}'" - sed -i "s|^site_url:.*|site_url: '${site_url}'|" mkdocs.yml - fi + echo "Setting site_url to ${{ steps.config.outputs.url }}" + sed -i "s|^site_url:.*|site_url: '${{ steps.config.outputs.url }}'|" mkdocs.yml - name: Build MkDocs run: mkdocs build + - name: Validate PAT + env: + GH_PAT: ${{ secrets.R_DEV_ENV_DOCS }} + run: | + curl -H "Authorization: token $GH_PAT" https://api.github.com/user || { + echo "PAT is invalid or expired" >&2 + exit 1 + } + - name: Deploy to GitHub Pages + env: + GH_PAT: ${{ secrets.R_DEV_ENV_DOCS }} run: | echo "Deploying from branch: ${{ github.ref_name }}" echo "Commit: ${{ github.sha }}" - echo "Deploying to: ${{ steps.config.outputs.repo}}" - - git config --global user.email "github-actions@github.com" - git config --global user.name "github-actions" - - git remote set-url origin \ - https://github.com/${{ steps.config.outputs.repo }} - mkdocs gh-deploy --config-file mkdocs.yml \ - --remote-branch gh-pages --force + git config --global credential.helper store + echo "https://x-access-token:${GH_PAT}@github.com" > ~/.git-credentials + git remote set-url origin https://github.com/${{ steps.config.outputs.target_repo }} + mkdocs gh-deploy --config-file mkdocs.yml --remote-branch gh-pages --force diff --git a/INIT b/INIT deleted file mode 100644 index bffd9aad0..000000000 --- a/INIT +++ /dev/null @@ -1,3 +0,0 @@ -This file is used as a marker to indicate when a codespace is first opened. - -See `scripts/welcome_message.sh` for use. diff --git a/docs/assets/svn1.png b/docs/assets/svn1.png new file mode 100644 index 000000000..44258543c Binary files /dev/null and b/docs/assets/svn1.png differ diff --git a/docs/assets/svn10.png b/docs/assets/svn10.png new file mode 100644 index 000000000..76c6bc4ca Binary files /dev/null and b/docs/assets/svn10.png differ diff --git a/docs/assets/svn12.png b/docs/assets/svn12.png new file mode 100644 index 000000000..9c41232ed Binary files /dev/null and b/docs/assets/svn12.png differ diff --git a/docs/assets/svn13.png b/docs/assets/svn13.png new file mode 100644 index 000000000..e8400fa83 Binary files /dev/null and b/docs/assets/svn13.png differ diff --git a/docs/assets/svn14.png b/docs/assets/svn14.png new file mode 100644 index 000000000..18602d51d Binary files /dev/null and b/docs/assets/svn14.png differ diff --git a/docs/assets/svn15.png b/docs/assets/svn15.png new file mode 100644 index 000000000..96a0a45ab Binary files /dev/null and b/docs/assets/svn15.png differ diff --git a/docs/assets/svn2.png b/docs/assets/svn2.png new file mode 100644 index 000000000..d86b1e90c Binary files /dev/null and b/docs/assets/svn2.png differ diff --git a/docs/assets/svn3.png b/docs/assets/svn3.png new file mode 100644 index 000000000..37b4122f6 Binary files /dev/null and b/docs/assets/svn3.png differ diff --git a/docs/assets/svn4.png b/docs/assets/svn4.png new file mode 100644 index 000000000..7704adcc6 Binary files /dev/null and b/docs/assets/svn4.png differ diff --git a/docs/assets/svn5.png b/docs/assets/svn5.png new file mode 100644 index 000000000..5fb7668eb Binary files /dev/null and b/docs/assets/svn5.png differ diff --git a/docs/assets/svn7.png b/docs/assets/svn7.png new file mode 100644 index 000000000..6a8ffef10 Binary files /dev/null and b/docs/assets/svn7.png differ diff --git a/docs/assets/svn8.png b/docs/assets/svn8.png new file mode 100644 index 000000000..e441c3b79 Binary files /dev/null and b/docs/assets/svn8.png differ diff --git a/docs/assets/svn9.png b/docs/assets/svn9.png new file mode 100644 index 000000000..2c4488bbe Binary files /dev/null and b/docs/assets/svn9.png differ diff --git a/docs/tutorials/Using_Source_Control_View.md b/docs/tutorials/Using_Source_Control_View.md new file mode 100644 index 000000000..d6dff5674 --- /dev/null +++ b/docs/tutorials/Using_Source_Control_View.md @@ -0,0 +1,86 @@ + +### Where to find ***"Source Control"*** ? + +(`Ctrl + Shift + G`) +![alt text](../assets/svn1.png) + +### What exactly Source Control is ? + +1. Source Control in Visual Studio Code (VS Code) is a built-in + feature that helps you to track, manage, and collaborate on + code changes using version control systems, especially Git. + +2. Source Control tracks every change you make to your code, + lets you undo mistakes, and helps you work with others. + +3. *for example*:- *Let's take a example rewriting a + code of askYesNo() function which we have seen + previously in* + [contribution_workflow.md](https://upgraded-computing-machine-4j6p6p44q5vvcq74x-8000.app.github.dev/tutorials/contribution_workflow/) + +* + +![alt text](../assets/svn2.png) + +### What are the different features of Source Control? + +Shows all modified, added, deleted, and renamed files +since the last commit. + +***Files are grouped into:*** + +* Changes -> + * Files that have been modified, created, or deleted but + not yet staged. + * These are shown uncommitted. + + ![alt text](../assets/svn9.png) + +### How to make a Change List ? + + ![alt text](../assets/svn5.png) + +* Enter the name of your change-List + + After just Press `Enter` to create a Change-List + for your Changes + + ![alt text](../assets/svn8.png) + +* ***Open Accessible Diff Viewer: (`F7`)*** + + ![alt text](../assets/svn10.png) + * View your changes(Diff) made at Present:(`F7`) + * ![alt text](../assets/svn12.png) + +* ***Revert Changes*** + * All the edits we have done in askYesNo() function + will undone + * ![alt text](../assets/svn3.png) + + * Output: + * ![alt text](../assets/svn7.png) + + * **Note:** + *Creating a Change-List for your changes helps + you revert a block of changes, undoing all of + them at once.* + +* **Note:** + *When we restart our VSCode, Codespace session, + or workspace, it forgets about the SVN repository + that we fetched.* + + * *The svn command lets you recognize your fetched SVN + repository again in the Source Control panel.* + + ```bash + cd $TOP_SRCDIR + svn update + ``` + +* ***Update:*** + * The Update option shown in the image below provides + the same output as the command mentioned above. + + * ![alt text](../assets/svn15.png) diff --git a/docs/tutorials/patch_update.md b/docs/tutorials/patch_update.md index 1a75b5c5d..614d90429 100644 --- a/docs/tutorials/patch_update.md +++ b/docs/tutorials/patch_update.md @@ -14,14 +14,24 @@ this first. Go to the source directory and use `svn diff` to create a patch. +**Use a descriptive patch name with the bug number and a short description, +rather than a generic name like `patch.diff`.** + ```bash cd $TOP_SRCDIR -svn diff > $PATCHDIR/patch.diff +svn diff > $PATCHDIR/16629-infinite-recursion.diff ``` +The example above uses `16629-infinite-recursion.diff` - this name follows the +convention: bug number (16629), short description (infinite-recursion), and +`.diff` extension, making patches easy to identify and review. + The patch file will be saved in the directory specified by the PATCHDIR -environment variable that is defined when the codespace starts +environment variable that is defined when the codespace starts. ```bash -echo $PATCHDIR/patch.diff +ls $PATCHDIR ``` + +lists all patch files in your patch directory, allowing you to easily +see and verify the patch files you have created.