Skip to content

Commit

Permalink
docs: Updating CONTRIBUTING.md with some info about feature branches (#…
Browse files Browse the repository at this point in the history
…1236)

Also updating GitHub workflows to run on feature branches as well.
  • Loading branch information
rohitkulshreshtha authored May 24, 2024
1 parent f21fe6f commit 0d2f14b
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- feature/**
tags:
- 'hydro_cli-v[0-9]+.[0-9]+.[0-9]+'

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: CI

on:
push:
branches: [main]
branches:
- main
- feature/**
pull_request:
schedule:
- cron: "35 03 * * *" # Daily at 8:35 PM PDT, 7:35 PM PST.
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/examples-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: examples-container-build

on:
push:
branches: [main]
branches:
- main
- feature/**

jobs:
pre_job:
Expand Down
32 changes: 26 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,35 @@ later. On Mac, installing directly from python.org may work if `brew install` do
cargo install wasm-bindgen-cli
```

## Commit Messages
## Submitting Changes

Commit messages should follow the [Conventional Commits specification](https://www.conventionalcommits.org/)
when submitting a PR. Alternatively, GitHub's "Squash and merge" feature can be used to adjust the
commit message, however those messages are not checked by CI.
### Feature Branches
Prototypes should be committed to feature branches, rather than main. To create a feature branch:

Commit messages are used to generate changelogs. See [Releasing](#releasing) for more.
```shell
git fetch origin
git checkout -b feature/$FEATURE_NAME origin/main
git push origin HEAD
```

To add changes on top of feature branches:
```shell
git checkout -b $BRANCH_NAME `feature/$FEATURE_NAME`
.. make changes ..
git add ... # Add all changes
git commit # Commit changes
git push origin HEAD
```

### Commit Messages

Pull request title and body should follow [Conventional Commits specification](https://www.conventionalcommits.org/).
The repository defaults to Squash+Merge commits, so individual commits are only useful for showing code evolution
during code-reviews.

Pull request title and body are used to generate changelogs. See [Releasing](#releasing) for more.

## Pull Requests and `precheck.bash`
### Pull Requests and `precheck.bash`

CI runs a comprehensive set of tests on PRs before they are merged. This includes format and lint
checks. To run some checks locally, you can run `./precheck.bash` (or `./precheck.bash --quick` for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ digraph {
n4v1 [label="(n4v1) source_iter_delta([(7, 0), (7, 1), (7, 2)])", shape=invhouse, fillcolor="#88aaff"]
n5v1 [label="(n5v1) map(|(k, v)| MapUnionSingletonMap::new_from((k, SetUnionSingletonSet::new_from(v))))", shape=invhouse, fillcolor="#88aaff"]
n6v1 [label="(n6v1) state::<'static, MapUnionHashMap<usize, SetUnionHashSet<usize>>>()", shape=invhouse, fillcolor="#88aaff"]
n7v1 [label="(n7v1) lattice_bimorphism(\l KeyedBimorphism::<\l HashMap<_, _>,\l _,\l >::from(CartesianProductBimorphism::<HashSet<_>>::default()),\l lhs,\l rhs,\l)\l", shape=invhouse, fillcolor="#88aaff"]
n7v1 [label="(n7v1) lattice_bimorphism(\l KeyedBimorphism::<\l HashMap<_, _>,\l _,\l >::new(CartesianProductBimorphism::<HashSet<_>>::default()),\l lhs,\l rhs,\l)\l", shape=invhouse, fillcolor="#88aaff"]
n8v1 [label="(n8v1) lattice_reduce()", shape=invhouse, fillcolor="#88aaff"]
n9v1 [label="(n9v1) for_each(|x| out_send.send(x).unwrap())", shape=house, fillcolor="#ffff88"]
n10v1 [label="(n10v1) handoff", shape=parallelogram, fillcolor="#ddddff"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ linkStyle default stroke:#aaa
4v1[\"(4v1) <code>source_iter_delta([(7, 0), (7, 1), (7, 2)])</code>"/]:::pullClass
5v1[\"(5v1) <code>map(|(k, v)| MapUnionSingletonMap::new_from((k, SetUnionSingletonSet::new_from(v))))</code>"/]:::pullClass
6v1[\"(6v1) <code>state::&lt;'static, MapUnionHashMap&lt;usize, SetUnionHashSet&lt;usize&gt;&gt;&gt;()</code>"/]:::pullClass
7v1[\"<div style=text-align:center>(7v1)</div> <code>lattice_bimorphism(<br> KeyedBimorphism::&lt;<br> HashMap&lt;_, _&gt;,<br> _,<br> &gt;::from(CartesianProductBimorphism::&lt;HashSet&lt;_&gt;&gt;::default()),<br> lhs,<br> rhs,<br>)</code>"/]:::pullClass
7v1[\"<div style=text-align:center>(7v1)</div> <code>lattice_bimorphism(<br> KeyedBimorphism::&lt;<br> HashMap&lt;_, _&gt;,<br> _,<br> &gt;::new(CartesianProductBimorphism::&lt;HashSet&lt;_&gt;&gt;::default()),<br> lhs,<br> rhs,<br>)</code>"/]:::pullClass
8v1[\"(8v1) <code>lattice_reduce()</code>"/]:::pullClass
9v1[/"(9v1) <code>for_each(|x| out_send.send(x).unwrap())</code>"\]:::pushClass
10v1["(10v1) <code>handoff</code>"]:::otherClass
Expand Down
2 changes: 1 addition & 1 deletion hydroflow/tests/surface_lattice_bimorphism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn test_join() {
lhs[items] -> [0]my_join;
rhs[items] -> [1]my_join;

my_join = lattice_bimorphism(KeyedBimorphism::<HashMap<_, _>, _>::from(CartesianProductBimorphism::<HashSet<_>>::default()), #lhs, #rhs)
my_join = lattice_bimorphism(KeyedBimorphism::<HashMap<_, _>, _>::new(CartesianProductBimorphism::<HashSet<_>>::default()), #lhs, #rhs)
-> lattice_reduce()
-> for_each(|x| out_send.send(x).unwrap());
};
Expand Down
21 changes: 11 additions & 10 deletions lattices/src/map_union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ pub struct KeyedBimorphism<MapOut, Bimorphism> {
bimorphism: Bimorphism,
_phantom: PhantomData<fn() -> MapOut>,
}
impl<MapOut, Bimorphism> From<Bimorphism> for KeyedBimorphism<MapOut, Bimorphism> {
fn from(bimorphism: Bimorphism) -> Self {
impl<MapOut, Bimorphism> KeyedBimorphism<MapOut, Bimorphism> {
/// Create a `KeyedBimorphism` using `bimorphism` for handling values.
pub fn new(bimorphism: Bimorphism) -> Self {
Self {
bimorphism,
_phantom: PhantomData,
Expand Down Expand Up @@ -398,57 +399,57 @@ mod test {
];

check_lattice_bimorphism(
KeyedBimorphism::<HashMap<_, _>, _>::from(
KeyedBimorphism::<HashMap<_, _>, _>::new(
CartesianProductBimorphism::<HashSet<_>>::default(),
),
items_a,
items_a,
);
check_lattice_bimorphism(
KeyedBimorphism::<HashMap<_, _>, _>::from(
KeyedBimorphism::<HashMap<_, _>, _>::new(
CartesianProductBimorphism::<HashSet<_>>::default(),
),
items_a,
items_b,
);
check_lattice_bimorphism(
KeyedBimorphism::<HashMap<_, _>, _>::from(
KeyedBimorphism::<HashMap<_, _>, _>::new(
CartesianProductBimorphism::<HashSet<_>>::default(),
),
items_b,
items_a,
);
check_lattice_bimorphism(
KeyedBimorphism::<HashMap<_, _>, _>::from(
KeyedBimorphism::<HashMap<_, _>, _>::new(
CartesianProductBimorphism::<HashSet<_>>::default(),
),
items_b,
items_b,
);

check_lattice_bimorphism(
KeyedBimorphism::<BTreeMap<_, _>, _>::from(
KeyedBimorphism::<BTreeMap<_, _>, _>::new(
CartesianProductBimorphism::<HashSet<_>>::default(),
),
items_a,
items_a,
);
check_lattice_bimorphism(
KeyedBimorphism::<BTreeMap<_, _>, _>::from(
KeyedBimorphism::<BTreeMap<_, _>, _>::new(
CartesianProductBimorphism::<HashSet<_>>::default(),
),
items_a,
items_b,
);
check_lattice_bimorphism(
KeyedBimorphism::<BTreeMap<_, _>, _>::from(
KeyedBimorphism::<BTreeMap<_, _>, _>::new(
CartesianProductBimorphism::<HashSet<_>>::default(),
),
items_b,
items_a,
);
check_lattice_bimorphism(
KeyedBimorphism::<BTreeMap<_, _>, _>::from(
KeyedBimorphism::<BTreeMap<_, _>, _>::new(
CartesianProductBimorphism::<HashSet<_>>::default(),
),
items_b,
Expand Down

0 comments on commit 0d2f14b

Please sign in to comment.