Skip to content

Commit b92c609

Browse files
Release pgx 0.5.0 (#751)
2 parents 1a89778 + 1ded855 commit b92c609

File tree

254 files changed

+83860
-150390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+83860
-150390
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ jobs:
147147
- name: Run bytea example tests
148148
run: cargo test --package bytea --features "pg$PG_VER" --no-default-features
149149

150+
- name: Run composite_type example tests
151+
run: cargo test --package composite_type --features "pg$PG_VER" --no-default-features
152+
150153
- name: Run custom_types example tests
151154
run: cargo test --package custom_types --features "pg$PG_VER" --no-default-features
152155

@@ -171,6 +174,9 @@ jobs:
171174
- name: Run spi example tests
172175
run: cargo test --package spi --features "pg$PG_VER" --no-default-features
173176

177+
- name: Run spi_srf example tests
178+
run: cargo test --package spi_srf --features "pg$PG_VER" --no-default-features
179+
174180
- name: Run srf example tests
175181
run: cargo test --package srf --features "pg$PG_VER" --no-default-features
176182

@@ -292,6 +298,9 @@ jobs:
292298
- name: Print sccache stats (before)
293299
run: sccache --show-stats
294300

301+
- name: Run rustfmt
302+
run: cargo fmt --all -- --check
303+
295304
- name: Install cargo-pgx
296305
run: cargo install --path cargo-pgx/ --debug --force
297306

CONTRIBUTING.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
## Dev Environment Setup
2+
3+
System Requirements:
4+
- Rustup (or equivalent toolchain manager like Nix). Users may be able to use distro toolchains, but you won't get far without a proper Rust toolchain manager.
5+
- Otherwise, same as the user requirements.
6+
7+
If you want to be ready to open a PR, you will want to run
8+
```bash
9+
git clone --branch develop "https://github.com/tcdi/pgx"
10+
cd pgx
11+
```
12+
That will put you in a cloned repository with the *develop* branch opened,
13+
which is the one you will be opening pull requests against in most cases.
14+
15+
After cloning the repository, mostly you can use similar flows as in the README.
16+
However, if there are any differences in `cargo pgx` since the last release, then
17+
the first and most drastic difference in the developer environment vs. the user environment is that you will have to run
18+
```bash
19+
cargo install cargo-pgx --path ./cargo-pgx \
20+
--force \
21+
--locked # This forces usage of the repo's lockfile
22+
cargo pgx init # This might take a while. Consider getting a drink.
23+
```
24+
25+
## Pull Requests (PRs)
26+
27+
- Pull requests for new code or bugfixes should be submitted against develop
28+
- All pull requests against develop will be squashed on merge
29+
- Tests are *expected* to pass before merging
30+
- PGX tests PRs on rustfmt so please run `cargo fmt` before you submit
31+
- Diffs in Cargo.lock should be checked in
32+
- HOWEVER, diffs in the bindgen in `pgx-pg-sys/src/pg*.rs` should **not** be checked in (this is a release task)
33+
34+
### Adding Dependencies
35+
36+
If a new crate dependency is required for a pull request, and it can't or should not be marked optional and behind some kind of feature flag, then it should have its reason for being used stated in the Cargo.toml it is added to. This can be "as a member of a category", in the case of e.g. error handling:
37+
38+
```toml
39+
# error handling and logging
40+
eyre = "0.6.8"
41+
thiserror = "1.0"
42+
tracing = "0.1.34"
43+
tracing-error = "0.2.0"
44+
```
45+
46+
It can be as notes for the individual dependencies:
47+
```toml
48+
once_cell = "1.10.0" # polyfill until std::lazy::OnceCell stabilizes
49+
```
50+
51+
Or it can be both:
52+
53+
```toml
54+
# exposed in public API
55+
atomic-traits = "0.3.0" # PgAtomic and shmem init
56+
bitflags = "1.3.2" # BackgroundWorker
57+
bitvec = "1.0" # processing array nullbitmaps
58+
```
59+
60+
You do not need exceptional justification notes in your PR to justify a new dependency as your code will, in most cases, self-evidently justify the use of the dependency. PGX uses the normal Rust approach of using dependencies based on their ability to improve correctness and make features possible. It does not reimplement things already available in the Rust ecosystem unless the addition is trivial (do not add custom derives to save 5~10 lines of code in one site) or the ecosystem crates are not compatible with Postgres (unfortunately common for Postgres data types).
61+
62+
## Releases
63+
64+
On a new PGX release, *develop* will be merged to *master* via merge commit.
65+
<!-- it's somewhat ambiguous whether we do this for stable or also "release candidate" releases -->
66+
67+
### Release Candidates AKA Betas
68+
PGX prefers using `x.y.z-{alpha,beta}.n` format for naming release candidates,
69+
starting at `alpha.0` if the new release candidate does not seem "feature complete",
70+
or at `beta.0` if it is not expected to need new feature work. Remember that `beta` will supersede `alpha` in versions for users who don't pin a version.
71+
72+
Publishing PGX is somewhat fraught, as all the crates really are intended to be published together as a single unit. There's no way to do a "dry run" of publishing multiple crates. Thus, it may be a good idea, when going from `m.n.o` to `m.n.p`, to preferentially publish `m.n.p-beta.0` instead of `m.n.p`, even if you are reasonably confident that **nothing** will happen.
73+
74+
### Checklist
75+
Do this *in order*:
76+
- [ ] Inform other maintainers of intent to publish a release
77+
- [ ] Assign an appropriate value to `NEW_RELEASE_VERSION`
78+
- [ ] Draft release notes for `${NEW_RELEASE_VERSION}`
79+
- [ ] Run `./update-versions.sh "${NEW_RELEASE_VERSION}"`
80+
- This will update the visible bindings of `pgx-pg-sys/src/pg*.rs`
81+
- The visible bindings are for reference, [docs][[email protected]], and tools
82+
- Actual users of the library rebuild the bindings from scratch
83+
- [ ] Run `./upgrade-deps.sh`
84+
- [ ] Push the resulting diffs to *develop*
85+
- [ ] Run `./publish.sh` to push the new version to [[email protected]]
86+
- If there was an error during publishing:
87+
- [ ] fix the error source
88+
- [ ] push any resulting diffs to *develop*
89+
- [ ] increment the patch version
90+
- [ ] try again
91+
92+
**Your work isn't done yet** just because it's on [crates.io], you also need to:
93+
- [ ] Open a PR against *master* for the changes from *develop*
94+
- [ ] *Switch* to using **merge commits** in this PR
95+
- [ ] Merge
96+
- [ ] Publish release notes
97+
- [ ] Celebrate
98+
99+
## Licensing
100+
101+
You agree that all code you submit in pull requests to https://github.com/tcdi/pgx/pulls
102+
is offered according to the MIT License, thus may be freely relicensed and sublicensed,
103+
and that you are satisfied with the existing copyright notice as of opening your PR.
104+
105+
[crates.io]: https://crates.io
106+
[[email protected]]: https://crates.io/crates/pgxa
107+
[[email protected]]: https://docs.rs/pgx/latest/pgx

0 commit comments

Comments
 (0)