Skip to content

Commit 8b4666e

Browse files
committed
(doc) Updates Contributing.md with Changes
1 parent ca94cc7 commit 8b4666e

File tree

1 file changed

+43
-16
lines changed

1 file changed

+43
-16
lines changed

CONTRIBUTING.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,62 @@ This document outlines how to help with development of the Chocolatey Quickstart
22

33
## Development
44

5-
When looking to make a change ensure any working branch is taken from `develop`. You can do this with the following:
5+
When looking to make a change ensure any working branch is taken from the tip of `main`. You can do this with the following:
66

77
```powershell
8-
git checkout develop
9-
git fetch upstream
10-
git rebase upstream/develop
11-
git push origin
12-
git checkout -b $NewBranchName
8+
$ChocolateyUpstream = ((git remote -v) -match "github.com/chocolatey/choco-quickstart-scripts.git \(fetch\)$" -split "\t")[0]
9+
git fetch $ChocolateyUpstream
10+
git checkout -b $NewBranchName $ChocolateyUpstream/main
1311
```
1412

15-
## Testing
13+
### Development Testing
1614

17-
Test your changes before raising a Pull Request to merge your changes. In order to set things up for testing do the following:
15+
You must test your changes before submitting a PR.
1816

19-
1. Set `$env:CHOCO_QSG_DEVELOP = $true`
20-
1. The first step of the Guide will need amended to fetch from the `develop` branch:
17+
You should test on a clean, supported operating system.
18+
19+
> NB: To save time in repeated testing from a clean environment, you can run the OfflineInstallPreparation script in your repository and copy the files directory before copying.
20+
21+
To test the quickstart environment:
22+
23+
1. Copy the repository directory over to `C:\choco-setup\files\` on the test machine. You do not need to copy the `.git` directory.
24+
1. Open an elevated Windows PowerShell console.
25+
1. Run `C:\choco-setup\files\Start-C4bSetup.ps1`, and continue through the guide steps as detailed in `README.md`.
26+
1. Run `C:\choco-setup\files\Start-C4bVerification.ps1` and check that all tests pass.
27+
28+
## Testing a PR
29+
30+
Changes in a PR must be tested before merging. In order to set things up for testing do the following in an elevated Windows PowerShell terminal:
31+
32+
1. Set `$env:CHOCO_QSG_BRANCH` to the PR ID or Branch Name to download.
33+
1. Run Quickstart Guide as documented, in the same session.
34+
35+
Example:
2136

2237
```powershell
38+
$env:CHOCO_QSG_BRANCH = "< Insert PR ID or Upstream BranchName Here >"
39+
2340
Set-ExecutionPolicy Bypass -Scope Process -Force
2441
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::tls12
25-
$QuickStart = 'https://raw.githubusercontent.com/chocolatey/choco-quickstart-scripts/develop/Start-C4bSetup.ps1'
26-
$Script = [System.Net.Webclient]::new().DownloadString($QuickStart)
27-
$sb = [ScriptBlock]::Create($Script)
28-
& $sb
42+
Invoke-RestMethod "https://ch0.co/qsg-go" | Invoke-Expression
2943
```
3044

3145
1. Perform each step of the Quickstart Guide, and make sure the changes you have attempted to make work appropriately.
46+
1. Run `Start-C4bVerification.ps1` and check that all tests pass.
3247
1. If everything looks OK, push your branch and create your Pull Request.
3348

34-
## SSL Certificates for testing
49+
## Creating a PR
50+
51+
Push your branch to a fork or repository, and create a new PR [here](https://github.com/chocolatey/choco-quickstart-scripts/compare).
52+
53+
You should fill out the issue template as much as possible.
3554

36-
Reach out to Stephen, and he can generate a Let's Encrypt certificate for you.
55+
### Rebasing Your Branch
56+
57+
If something else has been merged since you created your branch, you should rebase your branch onto the new tip of `main`. If you'd already pushed the branch, you may need to force-push the new history over the upstream version. You can do this as follows:
58+
59+
```powershell
60+
$ChocolateyUpstream = ((git remote -v) -match "github.com/chocolatey/choco-quickstart-scripts.git \(fetch\)$" -split "\t")[0]
61+
git fetch $ChocolateyUpstream
62+
git rebase $ChocolateyUpstream\main --autostash
63+
```

0 commit comments

Comments
 (0)