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

chore(root): Release 2024-11-06 08:05 #6866

Merged
merged 31 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3c0f109
chore(dashboard): InApp /docs redirect fix (#6831)
twentyone24 Nov 4, 2024
ddb101b
fix: update license name
scopsy Nov 4, 2024
76c03ca
feat(dashboard): Nv 4511 configure step the preview section (#6806)
BiswaViraj Nov 4, 2024
11ad3c5
feat(api): move step-schema to step (#6810)
tatarco Nov 4, 2024
4e6ef05
feat(dashboard): codemirror styling (#6830)
LetItRock Nov 4, 2024
b518a00
chore(root): remove QEMU setup action and streamline Docker buil… (#6…
merrcury Nov 4, 2024
8839201
feat(dashboard): workflow promotion (#6804)
ChmaraX Nov 4, 2024
17077bc
fix(dashboard): workflow row on-click redirect (#6839)
ChmaraX Nov 4, 2024
007fdb5
chore(dashboard): remove monaco editor from the dashboard (#6837)
LetItRock Nov 4, 2024
3f4f798
feat(api): Introduce includeTopics to GET /v1/subscribers/:id (#6838)
SokratisVidros Nov 4, 2024
8dd06b5
fix(api): Fix failing e2e
SokratisVidros Nov 4, 2024
d1c12d7
fix(dashboard): Display the workflowId, not the Mongo ObjectID (#6842)
SokratisVidros Nov 4, 2024
7a9b63b
fix(api): Feed includeTopics query parameter to OpenAPI spec generation
SokratisVidros Nov 4, 2024
7c56f24
fix(api): Fix typo
SokratisVidros Nov 4, 2024
28939d8
fix(root): multi-arch docker build for community (#6836)
merrcury Nov 4, 2024
2a64bdc
refactor(root): introducing graceful shutdown and optimise docker ima…
merrcury Nov 4, 2024
edb2cdd
fix(api): fix ui schema retrieval (#6844)
tatarco Nov 4, 2024
8635104
fix(root): update @nestjs/common and aws-sdk dependencies for consist…
merrcury Nov 4, 2024
3e59d05
bug(api): update pnpm (#6847)
tatarco Nov 4, 2024
7c4bf95
feat(application-generic, api, worker): Add instrumentation suffix bu…
rifont Nov 5, 2024
17efef6
feat(api): add support for env switch by slug (#6828)
djabarovgeorge Nov 5, 2024
b2e5128
feat(api): add step parse on preview (#6851)
djabarovgeorge Nov 5, 2024
ae84270
perf(api, worker): Add indexes to preferences schema for lookup (#6853)
rifont Nov 5, 2024
b62a423
feat(dashboard): In app template preview (#6843)
desiprisg Nov 5, 2024
597c388
fix(api): get step data (#6855)
djabarovgeorge Nov 5, 2024
e5b4c69
chore(dashboard): use step slug in the url (#6854)
LetItRock Nov 5, 2024
0999d22
revert(root): PR #6754 (#6856)
merrcury Nov 5, 2024
4a5e6b7
feat(dashboard): delete step editor functionality (#6860)
ChmaraX Nov 5, 2024
58aea73
feat(dashboard): generic confirmation modal (#6861)
ChmaraX Nov 5, 2024
a25dfef
fix(web): show organization verified domains (#6862)
ChmaraX Nov 5, 2024
25e39f5
chore(root): Remove Doppler.
SokratisVidros Nov 5, 2024
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
4 changes: 3 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,9 @@
"Sonner",
"sonner",
"cmdk",
"Keymap"
"Keymap",
"Syncable",
"lezer"
],
"flagWords": [],
"patterns": [
Expand Down
26 changes: 0 additions & 26 deletions .github/actions/setup-qemu/action.yml

This file was deleted.

76 changes: 38 additions & 38 deletions .github/workflows/prepare-self-hosted-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,10 @@ permissions:
id-token: write

jobs:
prepare:
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
latest-version: ${{ steps.get_version.outputs.latest-version }}
steps:
- uses: actions/checkout@v4
- name: Get Current Lerna Release version and comparing with the Git tag
id: get_version
shell: bash
run: |
LATEST_VERSION="v$(jq -r '.version' lerna.json)"
CURRENT_GIT_TAG="${{ github.ref_name }}"
if [ "$LATEST_VERSION" == "$CURRENT_GIT_TAG" ]
then
echo "latest-version=$(jq -r '.version' lerna.json)" >> $GITHUB_OUTPUT
else
echo "::error::The version in the file lerna.json does not match the git tag. The version in lerna.json is $LATEST_VERSION. The git version is $CURRENT_GIT_TAG"
exit 1
fi

build_docker:
runs-on: ubuntu-latest
needs: prepare
timeout-minutes: 90
environment: Production
strategy:
fail-fast: false
matrix:
Expand All @@ -50,13 +29,16 @@ jobs:
- name: Variables
shell: bash
run: |
echo "The release version is ${{ needs.prepare.outputs.latest-version }}"
service=${{ matrix.name }}
LATEST_VERSION=$(jq -r '.version' lerna.json)
SERVICE_NAME=$(basename "${service//-/-}")
SERVICE_COMMON_NAME=$(echo "$SERVICE_NAME" | sed 's/-ee$//')
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
echo "SERVICE_NAME=$SERVICE_NAME" >> $GITHUB_ENV
echo "SERVICE_COMMON_NAME=$SERVICE_COMMON_NAME" >> $GITHUB_ENV
echo "REGISTRY_OWNER=novuhq" >> $GITHUB_ENV
echo "This is the service name: $SERVICE_NAME and release version: $LATEST_VERSION"

- name: Install pnpm
uses: pnpm/action-setup@v3

Expand All @@ -69,19 +51,36 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup Docker
uses: crazy-max/ghaction-setup-docker@v2
with:
version: v24.0.6
daemon-config: |
{
"features": {
"containerd-snapshotter": true
}
}

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: 'image=moby/buildkit:v0.13.1'

- uses: ./.github/actions/free-space
name: Extend space in Action Container

- uses: ./.github/actions/setup-qemu
name: Setup QEMU and Docker Buildx

- name: Login To Registry
shell: bash
env:
GH_ACTOR: ${{ github.actor }}
GH_PASSWORD: ${{ secrets.GH_PACKAGES }}
run: |
echo $GH_PASSWORD | docker login ghcr.io -u $GH_ACTOR --password-stdin

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build ${{ env.SERVICE_NAME }} Community Docker Image
shell: bash
Expand All @@ -97,13 +96,13 @@ jobs:
if [ "${{ env.SERVICE_NAME }}" == "worker" ]; then
cd src/ && echo -e "\nIS_SELF_HOSTED=true\nOS_TELEMETRY_URL=\"${{ secrets.OS_TELEMETRY_URL }}\"" >> .example.env && cd ..
elif [ "${{ env.SERVICE_NAME }}" == "web" ]; then
cd src/ && echo -e "\nIS_V2_ENABLED=true" >> .env.sample && cd ..
echo -e "\nIS_V2_ENABLED=true" >> .env.sample
fi

pnpm run docker:build
docker images

- name: Check for EE files
if: "!contains(matrix.name, '-ee')"
id: check-ee-files
run: |
patterns=(
Expand All @@ -117,10 +116,11 @@ jobs:
fi
done
echo "No matching EE files found in the Docker image ${{ matrix.name }}"

- name: Tag and Push docker image
shell: bash
run: |
docker tag novu-$SERVICE_COMMON_NAME ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:${{ needs.prepare.outputs.latest-version }}
docker tag novu-$SERVICE_COMMON_NAME ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:${{ env.LATEST_VERSION }}
docker tag novu-$SERVICE_COMMON_NAME ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:latest
docker push ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:${{ needs.prepare.outputs.latest-version }}
docker push ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:${{ env.LATEST_VERSION }}
docker push ghcr.io/$REGISTRY_OWNER/${{ matrix.name }}:latest
File renamed without changes.
1 change: 0 additions & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
"@types/bull": "^3.15.8",
"@types/chai": "^4.2.11",
"@types/express": "4.17.17",
"@types/faker": "^6.6.9",
"@types/mocha": "^10.0.2",
"@types/node": "^20.15.0",
"@types/passport-github": "^1.1.5",
Expand Down
5 changes: 2 additions & 3 deletions apps/api/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable global-require */ import { DynamicModule, Logger, Module, Provider } from '@nestjs/common';
/* eslint-disable global-require */
import { DynamicModule, Logger, Module, Provider } from '@nestjs/common';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { Type } from '@nestjs/common/interfaces/type.interface';
import { ForwardReference } from '@nestjs/common/interfaces/modules/forward-reference.interface';
Expand Down Expand Up @@ -40,7 +41,6 @@ import { AnalyticsModule } from './app/analytics/analytics.module';
import { InboxModule } from './app/inbox/inbox.module';
import { BridgeModule } from './app/bridge/bridge.module';
import { PreferencesModule } from './app/preferences';
import { StepSchemasModule } from './app/step-schemas/step-schemas.module';
import { WorkflowModule } from './app/workflows-v2/workflow.module';
import { WorkflowModuleV1 } from './app/workflows-v1/workflow-v1.module';
import { EnvironmentsModuleV1 } from './app/environments-v1/environments-v1.module';
Expand Down Expand Up @@ -72,7 +72,6 @@ const enterpriseQuotaThrottlerInterceptor =
: [];

const baseModules: Array<Type | DynamicModule | Promise<DynamicModule> | ForwardReference> = [
StepSchemasModule,
AuthModule,
InboundParseModule,
SharedModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export class EnvironmentResponseDto {

@ApiProperty()
_parentId: string;

@ApiPropertyOptional()
slug?: string;
}

export interface IApiKeyDto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { Injectable, Logger, NotFoundException, Scope } from '@nestjs/common';

import { EnvironmentEntity, EnvironmentRepository } from '@novu/dal';
import { decryptApiKey } from '@novu/application-generic';
import { ShortIsPrefixEnum, EnvironmentEnum } from '@novu/shared';

import { GetMyEnvironmentsCommand } from './get-my-environments.command';
import { EnvironmentResponseDto } from '../../dtos/environment-response.dto';
import { buildSlug } from '../../../shared/helpers/build-slug';

@Injectable({
scope: Scope.REQUEST,
Expand Down Expand Up @@ -42,6 +44,19 @@ export class GetMyEnvironments {
};
});

return decryptedApiKeysEnvironment;
const shortEnvName = shortenEnvironmentName(decryptedApiKeysEnvironment.name);

return {
...decryptedApiKeysEnvironment,
slug: buildSlug(shortEnvName, ShortIsPrefixEnum.ENVIRONMENT, decryptedApiKeysEnvironment._id),
};
}
}
function shortenEnvironmentName(name: string): string {
const mapToShotEnvName: Record<EnvironmentEnum, string> = {
[EnvironmentEnum.PRODUCTION]: 'prod',
[EnvironmentEnum.DEVELOPMENT]: 'dev',
};

return mapToShotEnvName[name] || name;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable global-require */
import { BadRequestException, Inject, Injectable, Logger, Scope } from '@nestjs/common';
import { OrganizationEntity, OrganizationRepository, UserRepository } from '@novu/dal';
import { ApiServiceLevelEnum, JobTitleEnum, MemberRoleEnum } from '@novu/shared';
import { ApiServiceLevelEnum, JobTitleEnum, MemberRoleEnum, EnvironmentEnum } from '@novu/shared';
import { AnalyticsService } from '@novu/application-generic';

import { ModuleRef } from '@nestjs/core';
Expand Down Expand Up @@ -59,7 +59,7 @@ export class CreateOrganization {
const devEnv = await this.createEnvironmentUsecase.execute(
CreateEnvironmentCommand.create({
userId: user._id,
name: 'Development',
name: EnvironmentEnum.DEVELOPMENT,
organizationId: createdOrganization._id,
})
);
Expand All @@ -75,7 +75,7 @@ export class CreateOrganization {
const prodEnv = await this.createEnvironmentUsecase.execute(
CreateEnvironmentCommand.create({
userId: user._id,
name: 'Production',
name: EnvironmentEnum.PRODUCTION,
organizationId: createdOrganization._id,
parentEnvironmentId: devEnv._id,
})
Expand Down
12 changes: 12 additions & 0 deletions apps/api/src/app/shared/helpers/build-slug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ShortIsPrefixEnum, Slug, slugify } from '@novu/shared';
import { encodeBase62 } from './base62';

const SLUG_DELIMITER = '_';

/**
* Builds a slug for a step based on the step name, the short prefix and the internal ID.
* @returns The slug for the entity, example: slug: "workflow-name_wf_AbC1Xyz9KlmNOpQr"
*/
export function buildSlug(entityName: string, shortIsPrefix: ShortIsPrefixEnum, internalId: string): Slug {
return `${slugify(entityName)}${SLUG_DELIMITER}${shortIsPrefix}${encodeBase62(internalId)}`;
}
102 changes: 0 additions & 102 deletions apps/api/src/app/step-schemas/dtos/step-schema.dto.ts

This file was deleted.

Loading
Loading