Skip to content

Commit

Permalink
Merge pull request #43 from icann/andy_dev
Browse files Browse the repository at this point in the history
Lints and docs
  • Loading branch information
anewton1998 authored Dec 14, 2023
2 parents 0ba698e + c69b073 commit a286a2b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"icann-rdap-common",
"icann-rdap-srv"
]
resolver = "2"

[workspace.package]
version = "0.0.14"
Expand Down
4 changes: 2 additions & 2 deletions icann-rdap-client/src/md/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ mod tests {
#[test]
fn GIVEN_list_of_sentences_WHEN_make_list_all_title_case_THEN_each_sentence_all_title_cased() {
// GIVEN
let v = vec!["foo bar", "foO baR"];
let v = ["foo bar", "foO baR"];

// WHEN
let actual = v.make_list_all_title_case();
Expand All @@ -249,7 +249,7 @@ mod tests {
#[test]
fn GIVEN_list_WHEN_make_title_case_list_THEN_comma_separated_title_cased() {
// GIVEN
let list = vec!["foo bar", "bizz buzz"];
let list = ["foo bar", "bizz buzz"];

// WHEN
let actual = list.make_title_case_list();
Expand Down
4 changes: 2 additions & 2 deletions icann-rdap-common/src/contact/from_vcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ trait GetText<'a> {

impl<'a> GetText<'a> for Option<&'a Vec<Value>> {
fn get_text(self) -> Option<String> {
let Some(values) = self else { return None };
let values = self?;
let Some(fourth) = values.get(3) else {
return None;
};
Expand Down Expand Up @@ -377,7 +377,7 @@ trait GetNameParts<'a> {

impl<'a> GetNameParts<'a> for Option<&'a Vec<Value>> {
fn get_name_parts(self) -> Option<NameParts> {
let Some(values) = self else { return None };
let values = self?;
let Some(fourth) = values.get(3) else {
return None;
};
Expand Down
4 changes: 0 additions & 4 deletions icann-rdap-srv/src/bin/rdap-srv-test-data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ fn make_entity_template(
) -> Result<(), RdapServerError> {
let entity = make_test_entity(base_url, None);
let ids: Vec<EntityId> = (0..num_entities)
.into_iter()
.map(|x| {
EntityId::builder()
.handle(format!("test-entity-{x}"))
Expand All @@ -127,7 +126,6 @@ fn make_nameserver_template(
) -> Result<(), RdapServerError> {
let nameserver = make_test_nameserver(base_url, None)?;
let ids: Vec<NameserverId> = (0..num_nameservers)
.into_iter()
.map(|x| {
NameserverId::builder()
.ldh_name(format!("ns.test-nameserver-{x}.example"))
Expand Down Expand Up @@ -177,7 +175,6 @@ fn make_domain_template(
))
.build();
let ids: Vec<DomainId> = (0..num_domains)
.into_iter()
.map(|x| {
DomainId::builder()
.ldh_name(format!("test-domain-{x}.example"))
Expand Down Expand Up @@ -225,7 +222,6 @@ fn make_autnum_template(
))
.build();
let ids: Vec<AutnumId> = (0..num_autnums)
.into_iter()
.map(|x| AutnumId::builder().start_autnum(x).end_autnum(x).build())
.collect();
let template = Template::Autnum {
Expand Down
1 change: 1 addition & 0 deletions icann-rdap-srv/src/storage/pg/ops.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::diverging_sub_expression)]
use async_trait::async_trait;
use icann_rdap_common::response::RdapResponse;
use sqlx::{query, PgPool};
Expand Down
1 change: 1 addition & 0 deletions icann-rdap-srv/src/storage/pg/tx.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::diverging_sub_expression)]
use async_trait::async_trait;
use icann_rdap_common::response::{
autnum::Autnum, domain::Domain, entity::Entity, nameserver::Nameserver, network::Network,
Expand Down
23 changes: 23 additions & 0 deletions release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Release Process
===============

This is the release process which must be carried out by a maintainer
with proper GitHub and crates.io credentials. Without both, this will
fail.

1. Install the Cargo release plugin (if it is not already installed): `cargo install cargo-release`
1. On the 'dev' branch, use the cargo release plugin to bump either the patch, minor, or major version: `cargo release version patch -x`, `cargo release version minor -x` or `cargo release version major -x`.
1. Run the tests: `cargo test`
1. Commit these changes to git.
1. Push the changes to GitHub.
1. Do a PR from `dev` to `main`.
1. Wait for the test build.
1. Merge the PR.
1. Tag with version from step 2 as 'vVERSION' (lowercase 'v' followed by version number such as 'v0.0.5').
1. Push the tag to GitHub. This triggers a release build in GitHub Actions.
1. Wait until the release works. It may need some babysitting because the GitHub macOS and Windows builds are sometimes flaky).
1. Switch to main branch: `git switch main`
1. Update local repo branch: `git pull`.
1. Create a build in preparation for of publication to crates.io: `cargo build --release`.
1. Publish to crates.io: `cargo release publish -x` (on occasion this needs babysitting too).

0 comments on commit a286a2b

Please sign in to comment.