Skip to content

Commit

Permalink
feat(ci): Update CI to allow the chain-sync-v2 catalyst gateway branc…
Browse files Browse the repository at this point in the history
…h to build cleanly. (#306)

* ci(rust): Cat-Gateway has an unavoidable dependency on open-ssl.  Allow for now.

* feat(rust): Add a function to make syncing std rust config locally easier.

* feat(cspell): Use latest cspell tool, and add a function to clean project words file.

* fix(cspell): Missing FUNCTION keyword

* fix(docs): spelling

* feat(cspell): Add target to clean the spelling list

* fix(docs): Cleaned spelling list

* feat(mdlint): Bump mdlint version to latest

* fix(rust): sync deny.toml across utilities and examples

* feat(cat-ci): Add Justfile in root to make running some tasks easier.

* fix(rust): Missing FUNCTIOn keyword in sync-std-cfg function

* fix(rust): Fix reference to the rust installer package

* fix(cspell): Remove duplicate lines from the project dictionary

* fix(docs): cleanup duplicates from project dictionary

* fix(postgresql): Replace ancient "stable" sqlfluff debian distributes, with latest one.

* fix(mithril): Remove mithril snapshots from CI.

* style(postgresql): Adjust the sql code format to match requirements.
  • Loading branch information
stevenj authored Sep 13, 2024
1 parent 07c494c commit 43f3381
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 159 deletions.
7 changes: 2 additions & 5 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
aarch
bindgen
buildkit
binstall
buildkit
camelcase
canvaskit
cardano
Expand All @@ -17,7 +17,6 @@ dockerhub
doublecircle
Earthfile
Earthfiles
edgedriver
Edgedriver
errchkjson
extldflags
Expand All @@ -29,7 +28,6 @@ fontawesome
fontconfig
fontname
forcelabels
geckodriver
Geckodriver
genpkey
giga
Expand All @@ -39,7 +37,6 @@ glightbox
GOCACHE
gofmt
goimports
golangci
GOLANGCI
golines
golint
Expand Down Expand Up @@ -114,4 +111,4 @@ webkitallowfullscreen
WORKDIR
xerrors
zstd
zstdcat
zstdcat
2 changes: 1 addition & 1 deletion .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// markdownlint JSON(C) configuration for Catalyst Standards
// Do not individually set markdown lint rules in documents.
// It is permissable to disable a rule in a document if it is a false positive.
// It is permissible to disable a rule in a document if it is a false positive.
// Keep the scope of the lint disable to as small as possible.
// See: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
// Default state for all rules
Expand Down
5 changes: 5 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ markdown-check-fix:

DO mdlint-ci+MDLINT_LOCALLY --src=$(echo ${PWD}) --fix=--fix

# Make sure the project dictionary is properly sorted.
clean-spelling-list:
FROM debian:stable-slim
DO cspell-ci+CLEAN

# check-spelling Check spelling in this repo inside a container.
check-spelling:
DO cspell-ci+CHECK
Expand Down
20 changes: 20 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# use with https://github.com/casey/just
#

# cspell: words prereqs, commitlog

default:
@just --list --unsorted


# Fix and Check Markdown files
check-markdown:
earthly +markdown-check-fix

# Check Spelling
check-spelling:
earthly +clean-spelling-list
earthly +check-spelling

# Pre Push Checks - intended to be run by a git pre-push hook.
pre-push: check-markdown check-spelling
15 changes: 13 additions & 2 deletions earthly/cspell/Earthfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
VERSION 0.8

# CHECK: Check spelling in all files that are not explicitly excluded.
CHECK:
# Spell checking all docs and code is done with cspell
# See: cspell.org
Expand All @@ -11,9 +12,19 @@ CHECK:
# Unlikely to need to change this.
ARG cfg_file=cspell.json

FROM ghcr.io/streetsidesoftware/cspell:8.0.0
FROM ghcr.io/streetsidesoftware/cspell:8.13.3
WORKDIR /work

COPY $src .

RUN cspell-cli lint . --dot
RUN cspell-cli lint . --dot

# CLEAN: Cleanup the project dictionary.
CLEAN:
FUNCTION

COPY .config/dictionaries/project.dic project.dic
RUN sort -u -d -f project.dic > new.dic
IF ! diff -q project.dic new.dic
SAVE ARTIFACT new.dic AS LOCAL .config/dictionaries/project.dic
END
4 changes: 2 additions & 2 deletions earthly/mdlint/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ MDLINT_LOCALLY:
RUN docker run \
--rm \
-v $src:/workdir \
davidanson/markdownlint-cli2-rules:v0.11.0 \
davidanson/markdownlint-cli2-rules:v0.14.0 \
"**/*.md" \
--config $cfg_file \
$fix
Expand All @@ -61,7 +61,7 @@ CHECK:
# Unlikely this ever needs to be changed.
ARG cfg_file=.markdownlint-cli2.jsonc

FROM davidanson/markdownlint-cli2-rules:v0.11.0
FROM davidanson/markdownlint-cli2-rules:v0.14.0

# Status line for what we are about to do.
RUN echo Linting Markdown Recursively from: $src
Expand Down
133 changes: 0 additions & 133 deletions earthly/mithril_snapshot/Earthfile

This file was deleted.

5 changes: 3 additions & 2 deletions earthly/postgresql/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ postgres-base:
python3-psycopg \
ripgrep \
wget \
sqlfluff \
pipx \
&& rm -rf /var/lib/apt/lists/*

# Install SQLFluff - Check
RUN sqlfluff version
ENV PATH="/root/.local/bin:${PATH}"
RUN pipx install sqlfluff==3.1.1 && sqlfluff version

# Get refinery
COPY rust-tools+tool-refinery/refinery /bin
Expand Down
13 changes: 13 additions & 0 deletions earthly/rust/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,16 @@ SETUP:
# The ONLY toolchain we support is the one in the installer.
# DO NOT copy the `rust-toolchain.toml` file into CI as it breaks
# the toolchain on some targets and leads to build failure.


# SYNC_STD_CFG : Syncs the standard config files locally.
SYNC_STD_CFG:
FUNCTION
FROM +installer

SAVE ARTIFACT /stdcfgs/cargo_config.toml AS LOCAL .cargo/config.toml
SAVE ARTIFACT /stdcfgs/clippy.toml AS LOCAL clippy.toml
SAVE ARTIFACT /stdcfgs/nextest.toml AS LOCAL .config/nextest.toml
SAVE ARTIFACT /stdcfgs/deny.toml AS LOCAL deny.toml
SAVE ARTIFACT /stdcfgs/rustfmt.toml AS LOCAL rustfmt.toml
SAVE ARTIFACT /stdcfgs/rust-toolchain.toml AS LOCAL rust-toolchain.toml
9 changes: 6 additions & 3 deletions earthly/rust/stdcfgs/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ ignore = [
multiple-versions = "warn"
wildcards = 'deny'
deny = [
# { crate = "git2", use-instead = "gix" },
{ crate = "openssl", use-instead = "rustls" },
{ crate = "openssl-sys", use-instead = "rustls" },
# Scylla DB Drivers currently require OpenSSL. Its unavoidable.
# However, there is movement to enable support for Rustls.
# So, for now, allow open-ssl but it needs to be disabled as soon as Scylla DB enables Rustls.
#{ crate = "openssl", use-instead = "rustls" },
#{ crate = "openssl-sys", use-instead = "rustls" },
"libssh2-sys",
# { crate = "git2", use-instead = "gix" },
# { crate = "cmake", use-instead = "cc" },
# { crate = "windows", reason = "bloated and unnecessary", use-instead = "ideally inline bindings, practically, windows-sys" },
]
Expand Down
4 changes: 2 additions & 2 deletions examples/postgresql/migrations/V1__users.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE TABLE users
(
name VARCHAR PRIMARY KEY,
age INTEGER NOT NULL
name VARCHAR PRIMARY KEY,
age INTEGER NOT NULL
);
6 changes: 3 additions & 3 deletions examples/postgresql/migrations/V2__addresses.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE address
(
name VARCHAR PRIMARY KEY,
address TEXT NOT NULL,
name VARCHAR PRIMARY KEY,
address TEXT NOT NULL,

FOREIGN KEY (name) REFERENCES users (name)
FOREIGN KEY (name) REFERENCES users (name)
);
9 changes: 6 additions & 3 deletions examples/rust/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ ignore = [
multiple-versions = "warn"
wildcards = 'deny'
deny = [
# { crate = "git2", use-instead = "gix" },
{ crate = "openssl", use-instead = "rustls" },
{ crate = "openssl-sys", use-instead = "rustls" },
# Scylla DB Drivers currently require OpenSSL. Its unavoidable.
# However, there is movement to enable support for Rustls.
# So, for now, allow open-ssl but it needs to be disabled as soon as Scylla DB enables Rustls.
#{ crate = "openssl", use-instead = "rustls" },
#{ crate = "openssl-sys", use-instead = "rustls" },
"libssh2-sys",
# { crate = "git2", use-instead = "gix" },
# { crate = "cmake", use-instead = "cc" },
# { crate = "windows", reason = "bloated and unnecessary", use-instead = "ideally inline bindings, practically, windows-sys" },
]
Expand Down
9 changes: 6 additions & 3 deletions utilities/dbviz/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ ignore = [
multiple-versions = "warn"
wildcards = 'deny'
deny = [
# { crate = "git2", use-instead = "gix" },
{ crate = "openssl", use-instead = "rustls" },
{ crate = "openssl-sys", use-instead = "rustls" },
# Scylla DB Drivers currently require OpenSSL. Its unavoidable.
# However, there is movement to enable support for Rustls.
# So, for now, allow open-ssl but it needs to be disabled as soon as Scylla DB enables Rustls.
#{ crate = "openssl", use-instead = "rustls" },
#{ crate = "openssl-sys", use-instead = "rustls" },
"libssh2-sys",
# { crate = "git2", use-instead = "gix" },
# { crate = "cmake", use-instead = "cc" },
# { crate = "windows", reason = "bloated and unnecessary", use-instead = "ideally inline bindings, practically, windows-sys" },
]
Expand Down

0 comments on commit 43f3381

Please sign in to comment.