Skip to content

Commit 2741d8e

Browse files
committed
create CONTRIBUTING.md
1 parent 39a84b6 commit 2741d8e

File tree

2 files changed

+95
-96
lines changed

2 files changed

+95
-96
lines changed

CONTRIBUTING.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Contributing
2+
3+
Feel free to fork this project. We will happily merge bug fixes or other small
4+
improvements. For bigger changes you should probably get in touch with us
5+
before you start to avoid not seeing them merged.
6+
7+
## Testing
8+
9+
### Basic Tests
10+
11+
```bash
12+
make test
13+
```
14+
15+
### System Tests
16+
17+
System tests require:
18+
19+
1. Valid Transloadit credentials in environment:
20+
21+
```bash
22+
export TRANSLOADIT_KEY='your-auth-key'
23+
export TRANSLOADIT_SECRET='your-auth-secret'
24+
```
25+
26+
Then run:
27+
28+
```bash
29+
make test-all
30+
```
31+
32+
### Node.js Reference Implementation Parity Assertions
33+
34+
The SDK includes assertions that compare Smart CDN URL signatures and regular request signatures with our reference Node.js implementation. To run these tests:
35+
36+
1. Requirements:
37+
38+
- Node.js 20+ with npm
39+
- Ability to execute `npx transloadit smart_sig` (the CLI is downloaded on demand)
40+
- Ability to execute `npx transloadit sig` (the CLI is downloaded on demand)
41+
42+
2. Run the tests:
43+
44+
```bash
45+
export TRANSLOADIT_KEY='your-auth-key'
46+
export TRANSLOADIT_SECRET='your-auth-secret'
47+
TEST_NODE_PARITY=1 make test-all
48+
```
49+
50+
If you want to warm the CLI cache ahead of time you can run:
51+
52+
```bash
53+
npx --yes transloadit smart_sig --help
54+
```
55+
56+
For regular request signatures, you can also prime the CLI by running:
57+
58+
```bash
59+
TRANSLOADIT_KEY=... TRANSLOADIT_SECRET=... \
60+
npx --yes transloadit sig --algorithm sha1 --help
61+
```
62+
63+
CI opts into `TEST_NODE_PARITY=1`, and you can optionally do this locally as well.
64+
65+
### Run Tests in Docker
66+
67+
Use `scripts/test-in-docker.sh` for a reproducible environment:
68+
69+
```bash
70+
./scripts/test-in-docker.sh
71+
```
72+
73+
This builds the local image, runs `composer install`, and executes `make test-all` (unit + integration tests). Pass a custom command to run something else (composer install still runs first):
74+
75+
```bash
76+
./scripts/test-in-docker.sh vendor/bin/phpunit --filter signedSmartCDNUrl
77+
```
78+
79+
Environment variables such as `TEST_NODE_PARITY` or the credentials in `.env` are forwarded, so you can combine parity checks and integration tests with Docker:
80+
81+
```bash
82+
TEST_NODE_PARITY=1 ./scripts/test-in-docker.sh
83+
```
84+
85+
## Releasing a new version
86+
87+
To release, say `3.2.0` [Packagist](https://packagist.org/packages/transloadit/php-sdk), follow these steps:
88+
89+
1. Make sure `PACKAGIST_TOKEN` is set in your `.env` file
90+
1. Make sure you are in main: `git checkout main`
91+
1. Update `CHANGELOG.md` and `composer.json`
92+
1. Commit: `git add CHANGELOG.md composer.json && git commit -m "Release 3.2.0"`
93+
1. Tag, push, and release: `source .env && VERSION=3.2.0 ./release.sh`
94+
95+
This project implements the [Semantic Versioning](http://semver.org/) guidelines.

README.md

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -539,102 +539,6 @@ All of the following will cause an error string to be returned:
539539
540540
**_Note_**: You will need to set waitForCompletion = True in the $Transloadit->createAssembly($options) function call.
541541
542-
## Contributing
543-
544-
Feel free to fork this project. We will happily merge bug fixes or other small
545-
improvements. For bigger changes you should probably get in touch with us
546-
before you start to avoid not seeing them merged.
547-
548-
### Testing
549-
550-
#### Basic Tests
551-
552-
```bash
553-
make test
554-
```
555-
556-
#### System Tests
557-
558-
System tests require:
559-
560-
1. Valid Transloadit credentials in environment:
561-
562-
```bash
563-
export TRANSLOADIT_KEY='your-auth-key'
564-
export TRANSLOADIT_SECRET='your-auth-secret'
565-
```
566-
567-
Then run:
568-
569-
```bash
570-
make test-all
571-
```
572-
573-
#### Node.js Reference Implementation Parity Assertions
574-
575-
The SDK includes assertions that compare Smart CDN URL signatures and regular request signatures with our reference Node.js implementation. To run these tests:
576-
577-
1. Requirements:
578-
579-
- Node.js 20+ with npm
580-
- Ability to execute `npx transloadit smart_sig` (the CLI is downloaded on demand)
581-
- Ability to execute `npx transloadit sig` (the CLI is downloaded on demand)
582-
583-
2. Run the tests:
584-
585-
```bash
586-
export TRANSLOADIT_KEY='your-auth-key'
587-
export TRANSLOADIT_SECRET='your-auth-secret'
588-
TEST_NODE_PARITY=1 make test-all
589-
```
590-
591-
If you want to warm the CLI cache ahead of time you can run:
592-
593-
```bash
594-
npx --yes transloadit smart_sig --help
595-
```
596-
597-
For regular request signatures, you can also prime the CLI by running:
598-
599-
```bash
600-
TRANSLOADIT_KEY=... TRANSLOADIT_SECRET=... \
601-
npx --yes transloadit sig --algorithm sha1 --help
602-
```
603-
604-
CI opts into `TEST_NODE_PARITY=1`, and you can optionally do this locally as well.
605-
606-
#### Run Tests in Docker
607-
608-
Use `scripts/test-in-docker.sh` for a reproducible environment:
609-
610-
```bash
611-
./scripts/test-in-docker.sh
612-
```
613-
614-
This builds the local image, runs `composer install`, and executes `make test-all` (unit + integration tests). Pass a custom command to run something else (composer install still runs first):
615-
616-
```bash
617-
./scripts/test-in-docker.sh vendor/bin/phpunit --filter signedSmartCDNUrl
618-
```
619-
620-
Environment variables such as `TEST_NODE_PARITY` or the credentials in `.env` are forwarded, so you can combine parity checks and integration tests with Docker:
621-
622-
```bash
623-
TEST_NODE_PARITY=1 ./scripts/test-in-docker.sh
624-
```
625-
626-
### Releasing a new version
627-
628-
To release, say `3.2.0` [Packagist](https://packagist.org/packages/transloadit/php-sdk), follow these steps:
629-
630-
1. Make sure `PACKAGIST_TOKEN` is set in your `.env` file
631-
1. Make sure you are in main: `git checkout main`
632-
1. Update `CHANGELOG.md` and `composer.json`
633-
1. Commit: `git add CHANGELOG.md composer.json && git commit -m "Release 3.2.0"`
634-
1. Tag, push, and release: `source .env && VERSION=3.2.0 ./release.sh`
635-
636-
This project implements the [Semantic Versioning](http://semver.org/) guidelines.
637-
638542
## License
639543
640544
[MIT Licensed](LICENSE)

0 commit comments

Comments
 (0)