Skip to content

Commit 6532713

Browse files
committed
Merge branch 'release/v0.11.16'
2 parents f9cb0f6 + 0e1ff95 commit 6532713

25 files changed

Lines changed: 170 additions & 22522 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: check-changelog
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
check-changelog:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: tarides/changelog-check-action@v2
10+
with:
11+
changelog: CHANGELOG.md

.github/workflows/run_migrations.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,8 @@ jobs:
6666
with:
6767
command: run
6868
args: migrate
69+
- name: Revert migrations
70+
uses: actions-rs/cargo@v1
71+
with:
72+
command: run
73+
args: migrate --revert

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [[0.11.16]](https://github.com/thoth-pub/thoth/releases/tag/v0.11.16) - 2024-02-19
10+
### Changed
11+
- [561](https://github.com/thoth-pub/thoth/issues/561) - Add "Publisher Website" as a location platform
12+
- [553](https://github.com/thoth-pub/thoth/pull/553) - Upgrade rust to `1.76.0` in production and development `Dockerfile`
13+
- [305](https://github.com/thoth-pub/thoth/issues/305) - Update rust edition to 2021
14+
- [555](https://github.com/thoth-pub/thoth/pull/555) - Remove thoth-client's schema.json with auto-generated GraphQL schema language file on compilation
15+
16+
### Added
17+
- [244](https://github.com/thoth-pub/thoth/issues/244) - Expose GraphQL schema file in /schema.graphql
18+
- [503](https://github.com/thoth-pub/thoth/issues/503) - Allow reverting migrations in the CLI and check that migrations can be reverted in run-migration github action
19+
- [557](https://github.com/thoth-pub/thoth/pull/557) - Added github action to chech that the changelog has been updated on PRs
20+
921
## [[0.11.15]](https://github.com/thoth-pub/thoth/releases/tag/v0.11.15) - 2024-01-18
1022
### Changed
1123
- [536](https://github.com/thoth-pub/thoth/issues/536) - Rename "SciELO" location platform to "SciELO Books"

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "thoth"
3-
version = "0.11.15"
3+
version = "0.11.16"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
5-
edition = "2018"
5+
edition = "2021"
66
license = "Apache-2.0"
77
description = "GraphQL API for bibliographic data"
88
repository = "https://github.com/thoth-pub/thoth"
@@ -16,11 +16,11 @@ maintenance = { status = "actively-developed" }
1616
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]
1717

1818
[dependencies]
19-
thoth-api = { version = "0.11.15", path = "thoth-api", features = ["backend"] }
20-
thoth-api-server = { version = "0.11.15", path = "thoth-api-server" }
21-
thoth-app-server = { version = "0.11.15", path = "thoth-app-server" }
22-
thoth-errors = { version = "0.11.15", path = "thoth-errors" }
23-
thoth-export-server = { version = "0.11.15", path = "thoth-export-server" }
19+
thoth-api = { version = "0.11.16", path = "thoth-api", features = ["backend"] }
20+
thoth-api-server = { version = "0.11.16", path = "thoth-api-server" }
21+
thoth-app-server = { version = "0.11.16", path = "thoth-app-server" }
22+
thoth-errors = { version = "0.11.16", path = "thoth-errors" }
23+
thoth-export-server = { version = "0.11.16", path = "thoth-export-server" }
2424
clap = { version = "4.4.7", features = ["cargo", "env"] }
2525
dialoguer = { version = "0.11.0", features = ["password"] }
2626
dotenv = "0.15.0"

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG RUST_IMAGE=rust:1.75.0
2-
ARG MUSL_IMAGE=clux/muslrust:1.75.0
1+
ARG RUST_IMAGE=rust:1.76.0
2+
ARG MUSL_IMAGE=clux/muslrust:1.76.0
33

44
FROM ${RUST_IMAGE} as wasm
55

Dockerfile.dev

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG RUST_VERSION=1.75.0
1+
ARG RUST_VERSION=1.76.0
22

33
FROM rust:${RUST_VERSION}
44

@@ -48,6 +48,7 @@ RUN mkdir thoth-api/src thoth-api-server/src thoth-app/src \
4848
RUN touch thoth-api/src/lib.rs thoth-api-server/src/lib.rs \
4949
thoth-app/src/lib.rs thoth-app-server/src/lib.rs thoth-client/src/lib.rs \
5050
thoth-errors/src/lib.rs thoth-export-server/src/lib.rs
51+
RUN echo "fn main() {}" > thoth-client/build.rs
5152
RUN wasm-pack build thoth-app/ \
5253
--target web \
5354
--debug

src/bin/thoth.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use clap::{crate_authors, crate_version, value_parser, Arg, Command};
1+
use clap::{crate_authors, crate_version, value_parser, Arg, ArgAction, Command};
22
use dialoguer::{console::Term, theme::ColorfulTheme, Input, MultiSelect, Password, Select};
33
use dotenv::dotenv;
44
use std::env;
55
use thoth::api::account::model::{AccountData, LinkedPublisher};
66
use thoth::api::account::service::{all_emails, all_publishers, register, update_password};
7-
use thoth::api::db::{establish_connection, run_migrations};
7+
use thoth::api::db::{establish_connection, revert_migrations, run_migrations};
88
use thoth::api_server;
99
use thoth::app_server;
1010
use thoth::export_server;
@@ -129,7 +129,16 @@ fn thoth_commands() -> Command {
129129
.about(env!("CARGO_PKG_DESCRIPTION"))
130130
.subcommand_required(true)
131131
.arg_required_else_help(true)
132-
.subcommand(Command::new("migrate").about("Run the database migrations"))
132+
.subcommand(
133+
Command::new("migrate")
134+
.about("Run the database migrations")
135+
.arg(
136+
Arg::new("revert")
137+
.long("revert")
138+
.help("Revert all database migrations")
139+
.action(ArgAction::SetTrue),
140+
),
141+
)
133142
.subcommand(
134143
Command::new("start")
135144
.about("Start an instance of Thoth API or GUI")
@@ -240,7 +249,10 @@ fn main() -> ThothResult<()> {
240249
}
241250
_ => unreachable!(),
242251
},
243-
Some(("migrate", _)) => run_migrations(),
252+
Some(("migrate", migrate_matches)) => match migrate_matches.get_flag("revert") {
253+
true => revert_migrations(),
254+
false => run_migrations(),
255+
},
244256
Some(("init", init_matches)) => {
245257
let host = init_matches.get_one::<String>("host").unwrap().to_owned();
246258
let port = init_matches.get_one::<String>("port").unwrap().to_owned();

thoth-api-server/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[package]
22
name = "thoth-api-server"
3-
version = "0.11.15"
3+
version = "0.11.16"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
5-
edition = "2018"
5+
edition = "2021"
66
license = "Apache-2.0"
77
description = "Actix instance serving Thoth's GraphQL endpoints"
88
repository = "https://github.com/thoth-pub/thoth"
99
readme = "README.md"
1010

1111
[dependencies]
12-
thoth-api = { version = "0.11.15", path = "../thoth-api", features = ["backend"] }
13-
thoth-errors = { version = "0.11.15", path = "../thoth-errors" }
12+
thoth-api = { version = "0.11.16", path = "../thoth-api", features = ["backend"] }
13+
thoth-errors = { version = "0.11.16", path = "../thoth-errors" }
1414
actix-web = "4.4.1"
1515
actix-cors = "0.7.0"
1616
actix-identity = "0.6.0"

thoth-api-server/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ async fn graphql_index(config: Data<ApiConfig>) -> HttpResponse {
8484
))
8585
}
8686

87+
#[get("/schema.graphql")]
88+
async fn graphql_schema(st: Data<Arc<Schema>>) -> HttpResponse {
89+
HttpResponse::Ok().body(st.as_schema_language())
90+
}
91+
8792
#[post("/graphql")]
8893
async fn graphql(
8994
st: Data<Arc<Schema>>,
@@ -192,6 +197,7 @@ fn config(cfg: &mut ServiceConfig) {
192197
cfg.service(login_credentials);
193198
cfg.service(login_session);
194199
cfg.service(account_details);
200+
cfg.service(graphql_schema);
195201
}
196202

197203
#[allow(clippy::too_many_arguments)]

0 commit comments

Comments
 (0)