Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Default to Cloud mode following RFC #51

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/convention.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Convention Commit

on:
pull_request:

permissions:
pull-requests: read
statuses: write

jobs:
lint:
name: Validate PR title
runs-on: ubuntu-latest
if: ${{ ! contains(github.head_ref, 'release/') }}
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
wip: true
1 change: 0 additions & 1 deletion deploy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ configMapGenerator:

- INNGEST_SIGNING_KEY=REPLACE_SIGNING_KEY
- INNGEST_EVENT_KEY=REPLACE_EVENT_KEY
- INNGEST_MODE=cloud

resources:
- namespace.yaml
Expand Down
2 changes: 1 addition & 1 deletion inngest/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct Inngest {
pub(crate) event_api_origin: Option<String>,
pub(crate) event_key: Option<String>,
pub(crate) env: Option<String>,
dev: Option<String>,
pub(crate) dev: Option<String>,
http: reqwest::Client,
}

Expand Down
15 changes: 0 additions & 15 deletions inngest/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use std::env;

use crate::handler::Kind;

// client side
const INNGEST_API_ORIGIN: &str = "INNGEST_API_ORIGIN";
const INNGEST_EVENT_API_ORIGIN: &str = "INNGEST_EVENT_API_ORIGIN";
Expand All @@ -14,9 +12,6 @@ const INNGEST_SIGNING_KEY: &str = "INNGEST_SIGNING_KEY";
const INNGEST_SERVE_ORIGIN: &str = "INNGEST_SERVE_ORIGIN";
const INNGEST_SERVE_PATH: &str = "INNGEST_SERVE_PATH";

// optional
const INNGEST_MODE: &str = "INNGEST_MODE";

pub(crate) struct Config {}

impl Config {
Expand Down Expand Up @@ -52,16 +47,6 @@ impl Config {
Self::read_env_str(INNGEST_SERVE_PATH)
}

pub fn mode() -> Kind {
match Self::read_env_str(INNGEST_MODE) {
None => Kind::Dev,
Some(v) => match v.to_lowercase().as_str() {
"cloud" => Kind::Cloud,
_ => Kind::Dev,
},
}
}

// helper methods
fn read_env_str(key: &str) -> Option<String> {
match env::var(key) {
Expand Down
9 changes: 8 additions & 1 deletion inngest/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ impl<T, E> Handler<T, E> {
let signing_key = Config::signing_key();
let serve_origin = Config::serve_origin();
let serve_path = Config::serve_path();
let mode = Config::mode();
let mode = match client.dev.clone() {
None => Kind::Cloud,
Some(v) => if v != "0" {
Kind::Dev
} else {
Kind::Cloud
}
};

Handler {
signing_key,
Expand Down
Loading