Skip to content

Commit

Permalink
Miscellaneous CI cleanup (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored Oct 5, 2023
1 parent 5a2a4aa commit 5b9f98d
Show file tree
Hide file tree
Showing 21 changed files with 123 additions and 233 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches: [main, release/*]
pull_request:
branches: [main]
branches:
- "main"
- "release/*"

jobs:
build:
Expand All @@ -31,7 +33,6 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_CHECKOUT }}

- uses: dtolnay/rust-toolchain@stable

Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/dev-debian.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .github/workflows/dev-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ name: Dev Docker Images
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
docker-build:
strategy:
matrix:
runner: [ubuntu-latest, ubicloud]
runner: [ubicloud]
runs-on: ${{ matrix.runner }}
permissions:
contents: read
Expand All @@ -20,7 +18,6 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_CHECKOUT }}

- uses: depot/setup-action@v1

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Flow build and test

on:
pull_request:
branches: [main]
branches:
- "main"
push:
branches: [main]

Expand Down Expand Up @@ -34,7 +35,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.19.0'
go-version: ">=1.19.0"

- name: install gotestsum
run: |
Expand Down Expand Up @@ -73,7 +74,7 @@ jobs:

- name: run tests
run: |
gotestsum --format testname -- -p 4 ./... -timeout 1200s
gotestsum --format testname -- -p 4 ./... -timeout 2400s
working-directory: ./flow
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/golang-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: GolangCI-Lint

on: [pull_request]
on:
pull_request:
branches:
- "main"

jobs:
golangci-lint:
Expand All @@ -10,14 +13,13 @@ jobs:
pull-requests: write
strategy:
matrix:
runner: [ubuntu-latest, ubicloud]
runner: [ubicloud]
runs-on: ${{ matrix.runner }}
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_CHECKOUT }}

- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/rust-lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: clippy-action
on: [pull_request]

on:
pull_request:
branches:
- "main"

jobs:
clippy:
permissions:
Expand All @@ -8,23 +13,18 @@ jobs:
pull-requests: write
strategy:
matrix:
runner: [ubuntu-latest, ubicloud]
runner: [ubicloud-standard-4]
runs-on: ${{ matrix.runner }}
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_CHECKOUT }}
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}
workdir: ./nexus
env:
REVIEWDOG_TOKEN: ${{ secrets.REVIEWDOG_TOKEN }}
- name: clippy
run: cargo clippy -- -D warnings
working-directory: ./nexus
62 changes: 0 additions & 62 deletions .github/workflows/stable-debian.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/stable-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
docker-build:
strategy:
matrix:
runner: [ubuntu-latest, ubicloud]
runner: [ubicloud]
runs-on: ${{ matrix.runner }}
permissions:
contents: read
Expand All @@ -19,7 +19,6 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_CHECKOUT }}

- uses: depot/setup-action@v1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ui-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Build & Test UI
strategy:
matrix:
runner: [ubuntu-latest, ubicloud]
runner: [ubicloud]
runs-on: ${{ matrix.runner }}
steps:
- name: checkout
Expand All @@ -25,4 +25,4 @@ jobs:

- name: Build
working-directory: ui
run: yarn build
run: yarn build
4 changes: 2 additions & 2 deletions .github/workflows/ui-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Run UI linters
strategy:
matrix:
runner: [ubuntu-latest, ubicloud]
runner: [ubicloud]
runs-on: ${{ matrix.runner }}
steps:
- name: checkout
Expand All @@ -33,4 +33,4 @@ jobs:
eslint: true
prettier: true
eslint_dir: ui
prettier_dir: ui
prettier_dir: ui
7 changes: 3 additions & 4 deletions nexus/parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct NexusQueryParser {
pub enum NexusStatement {
PeerDDL {
stmt: Statement,
ddl: PeerDDL,
ddl: Box<PeerDDL>,
},
PeerQuery {
stmt: Statement,
Expand Down Expand Up @@ -55,7 +55,7 @@ impl NexusStatement {
if let Some(ddl) = ddl {
return Ok(NexusStatement::PeerDDL {
stmt: stmt.clone(),
ddl,
ddl: Box::new(ddl),
});
}

Expand Down Expand Up @@ -100,8 +100,7 @@ impl NexusQueryParser {
let peers = tokio::task::block_in_place(move || {
tokio::runtime::Handle::current().block_on(async move {
let catalog = self.catalog.lock().await;
let peers = catalog.get_peers().await;
peers
catalog.get_peers().await
})
});

Expand Down
24 changes: 13 additions & 11 deletions nexus/peer-bigquery/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,19 @@ impl BigqueryAst {

visit_function_arg_mut(query, |node| {
if let FunctionArgExpr::Expr(arg_expr) = node {
if let Expr::Cast { expr: _, data_type } = arg_expr {
if let DataType::Array(_) = data_type {
let list = self
.flatten_expr_to_in_list(&arg_expr)
.expect("failed to flatten in function");
let rewritten_array = Array {
elem: list,
named: true,
};
*node = FunctionArgExpr::Expr(Expr::Array(rewritten_array));
}
if let Expr::Cast {
expr: _,
data_type: DataType::Array(_),
} = arg_expr
{
let list = self
.flatten_expr_to_in_list(arg_expr)
.expect("failed to flatten in function");
let rewritten_array = Array {
elem: list,
named: true,
};
*node = FunctionArgExpr::Expr(Expr::Array(rewritten_array));
}
}

Expand Down
2 changes: 0 additions & 2 deletions nexus/peer-bigquery/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use sqlparser::ast::Statement;
use crate::BigQueryQueryExecutor;

pub struct BigQueryCursor {
stmt: Statement,
position: usize,
stream: Mutex<SendableStream>,
schema: SchemaRef,
Expand Down Expand Up @@ -42,7 +41,6 @@ impl BigQueryCursorManager {

// Create a new cursor
let cursor = BigQueryCursor {
stmt: stmt.clone(),
position: 0,
stream: Mutex::new(stream),
schema,
Expand Down
2 changes: 1 addition & 1 deletion nexus/peer-cursor/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub fn records_to_query_response<'a>(records: Records) -> PgWireResult<Response<
let pg_schema: Arc<Vec<FieldInfo>> = Arc::new(records.schema.fields.clone());
let schema_copy = pg_schema.clone();

let data_row_stream = stream::iter(records.records.into_iter())
let data_row_stream = stream::iter(records.records)
.map(move |record| {
let mut encoder = DataRowEncoder::new(schema_copy.clone());
for value in record.values.iter() {
Expand Down
Loading

0 comments on commit 5b9f98d

Please sign in to comment.