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

feat: centralize flow issues #4571

Merged
merged 29 commits into from May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
eba8b0c
feat: issues
Apr 28, 2024
0134392
Merge remote-tracking branch 'origin/main' into pr/ShahedAlMashni/4571
abuaboud May 5, 2024
ea9fb33
chore: add postgres migratiion
abuaboud May 5, 2024
a6b658d
chore: change flow name
abuaboud May 5, 2024
ecd3af2
chore: enhance ui of issues table
AbdulTheActivePiecer May 5, 2024
231c982
chore: add confirm action dialog to resolve issue
AbdulTheActivePiecer May 5, 2024
9dc732b
fix: remove test data from issues data source
AbdulTheActivePiecer May 5, 2024
84dfd32
chore: enable resolving issues
AbdulTheActivePiecer May 5, 2024
4025b1e
chore: added check icon inside mark as resolved btn and improved its …
AbdulTheActivePiecer May 5, 2024
9b84d65
chore: moved runs and issues into one page called executions
AbdulTheActivePiecer May 5, 2024
5503c04
chore: handle old runs route and switching between tabs in executions
AbdulTheActivePiecer May 5, 2024
e60bac6
fix: upgrade note note working for git-sync, projects and audit
AbdulTheActivePiecer May 6, 2024
1403bf2
Merge branch 'main' into feat/issues
AbdulTheActivePiecer May 14, 2024
2d5b89c
chore: unite execution fragment names source
AbdulTheActivePiecer May 14, 2024
7e95355
chore: added notification icon to isssues
AbdulTheActivePiecer May 14, 2024
55273cd
chore: lock issues feature
AbdulTheActivePiecer May 14, 2024
b5b691e
chore: guard issues controller by platform feature flag
AbdulTheActivePiecer May 14, 2024
7bfc164
chore: merge diff
AbdulTheActivePiecer May 15, 2024
67c08b8
Merge branch 'feat/issues' of github.com:ShahedAlMashni/activepieces …
AbdulTheActivePiecer May 15, 2024
022fe09
chore: bump shared
AbdulTheActivePiecer May 15, 2024
56119c3
chore: address comments
AbdulTheActivePiecer May 15, 2024
e165491
chore: add telemetry for issues
abuaboud May 15, 2024
1cb5df6
chore: push note in issues demo
abuaboud May 15, 2024
68f725b
chore: hide executions for embedding
AbdulTheActivePiecer May 15, 2024
cc3f5d0
Merge branch 'feat/issues' of github.com:ShahedAlMashni/activepieces …
AbdulTheActivePiecer May 15, 2024
06d8a5e
fix: lint api and test
abuaboud May 16, 2024
c09f2b2
Merge remote-tracking branch 'origin/main' into pr/ShahedAlMashni/4571
abuaboud May 16, 2024
9620700
fix: flow template test
abuaboud May 16, 2024
fdc8c98
fix: flow template test
abuaboud May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/ee/shared/src/index.ts
Expand Up @@ -17,4 +17,6 @@ export * from './lib/managed-authn'
export * from './lib/oauth-apps'
export * from './lib/otp'
export * from './lib/authn'
export * from './lib/activity'
export * from './lib/activity'

export * from './lib/issues'
2 changes: 2 additions & 0 deletions packages/ee/shared/src/lib/issues/index.ts
@@ -0,0 +1,2 @@
export * from './issues-requests'
export * from './issue-dto'
25 changes: 25 additions & 0 deletions packages/ee/shared/src/lib/issues/issue-dto.ts
@@ -0,0 +1,25 @@
import { Static, Type } from "@sinclair/typebox";
import { ApId, BaseModelSchema } from "@activepieces/shared";

export enum IssueStatus {
ONGOING = 'ONGOING',
RESOLEVED = 'RESOLEVED',
}

export const Issue = Type.Object({
...BaseModelSchema,
projectId: ApId,
flowId: ApId,
status: Type.Enum(IssueStatus),
count: Type.Number(),
lastOccurrence: Type.String(),
})

export type Issue = Static<typeof Issue>


export const PopulatedIssue = Type.Composite([Issue, Type.Object({
flowDisplayName: Type.String()
})])

export type PopulatedIssue = Static<typeof PopulatedIssue>
17 changes: 17 additions & 0 deletions packages/ee/shared/src/lib/issues/issues-requests.ts
@@ -0,0 +1,17 @@

import { Type, Static } from '@sinclair/typebox'
import { ApId } from '@activepieces/shared'
import { IssueStatus } from './issue-dto'

export const ListIssuesParams = Type.Object({
projectId: ApId,
cursor: Type.Optional(Type.String()),
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 100 })),
})
export type ListIssuesParams = Static<typeof ListIssuesParams>

export const UpdateIssueRequestBody = Type.Object({
status: Type.Enum(IssueStatus),
})

export type UpdateIssueRequestBody = Static<typeof UpdateIssueRequestBody>
2 changes: 1 addition & 1 deletion packages/pieces/community/activepieces/package.json
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.5",
"dependencies": {
"@activepieces/pieces-common": "0.2.12",
"@activepieces/pieces-framework": "0.7.29",
"@activepieces/pieces-framework": "0.7.30",
"tslib": "2.6.2"
}
}
Expand Up @@ -2,7 +2,7 @@
"name": "@activepieces/piece-brilliant-directories",
"version": "0.0.7",
"dependencies": {
"@activepieces/pieces-framework": "0.7.29",
"@activepieces/pieces-framework": "0.7.30",
"@activepieces/pieces-common": "0.2.12",
"tslib": "^2.6.2",
"@activepieces/shared": "*"
Expand Down
2 changes: 1 addition & 1 deletion packages/pieces/community/convertkit/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "@activepieces/piece-convertkit",
"version": "0.2.0",
"dependencies": {
"@activepieces/pieces-framework": "0.7.29",
"@activepieces/pieces-framework": "0.7.30",
"@activepieces/pieces-common": "0.2.12",
"tslib": "^2.6.2",
"@activepieces/shared": "*"
Expand Down
4 changes: 2 additions & 2 deletions packages/pieces/community/math-helper/package.json
Expand Up @@ -2,8 +2,8 @@
"name": "@activepieces/piece-math-helper",
"version": "0.0.7",
"dependencies": {
"@activepieces/pieces-framework": "0.7.29",
"@activepieces/shared": "0.10.104",
"@activepieces/pieces-framework": "0.7.30",
"@activepieces/shared": "0.10.105",
"tslib": "2.6.2"
}
}
4 changes: 2 additions & 2 deletions packages/pieces/community/retune/package.json
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.6",
"dependencies": {
"@activepieces/pieces-common": "0.2.12",
"@activepieces/pieces-framework": "0.7.29",
"@activepieces/shared": "0.10.104",
"@activepieces/pieces-framework": "0.7.30",
"@activepieces/shared": "0.10.105",
"tslib": "2.6.2"
}
}
2 changes: 1 addition & 1 deletion packages/pieces/community/saastic/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "@activepieces/piece-saastic",
"version": "0.0.7",
"dependencies": {
"@activepieces/pieces-framework": "0.7.29",
"@activepieces/pieces-framework": "0.7.30",
"@activepieces/pieces-common": "0.2.12",
"tslib": "^2.6.2",
"@activepieces/shared": "*"
Expand Down
3 changes: 3 additions & 0 deletions packages/server/api/src/app/app.ts
Expand Up @@ -41,6 +41,7 @@ import { platformFlowTemplateModule } from './ee/flow-template/platform-flow-tem
import { platformWorkerHooks } from './ee/flow-worker/cloud-flow-worker-hooks'
import { gitRepoModule } from './ee/git-repos/git-repo.module'
import { platformDomainHelper } from './ee/helper/platform-domain-helper'
import { issuesModule } from './ee/issues/issues-module'
import { managedAuthnModule } from './ee/managed-authn/managed-authn-module'
import { oauthAppModule } from './ee/oauth-apps/oauth-app.module'
import { otpModule } from './ee/otp/otp-module'
Expand Down Expand Up @@ -252,6 +253,8 @@ export const setupApp = async (): Promise<FastifyInstance> => {
await pieceSyncService.setup()
await app.register(flowWorkerModule)
await app.register(platformUserModule)
await app.register(issuesModule)

await setupBullMQBoard(app)

app.get(
Expand Down
8 changes: 5 additions & 3 deletions packages/server/api/src/app/database/database-connection.ts
Expand Up @@ -16,6 +16,7 @@ import { ConnectionKeyEntity } from '../ee/connection-keys/connection-key.entity
import { CustomDomainEntity } from '../ee/custom-domains/custom-domain.entity'
import { FlowTemplateEntity } from '../ee/flow-template/flow-template.entity'
import { GitRepoEntity } from '../ee/git-repos/git-repo.entity'
import { IssueEntity } from '../ee/issues/issues-entity'
import { OAuthAppEntity } from '../ee/oauth-apps/oauth-app.entity'
import { OtpEntity } from '../ee/otp/otp-entity'
import { ProjectMemberEntity } from '../ee/project-members/project-member.entity'
Expand Down Expand Up @@ -68,6 +69,7 @@ function getEntities(): EntitySchema<unknown>[] {
PlatformEntity,
TagEntity,
PieceTagEntity,
IssueEntity,
]

switch (edition) {
Expand Down Expand Up @@ -120,9 +122,9 @@ export const commonProperties = {
}

export const databaseConnection =
databaseType === DatabaseType.SQLITE3
? createSqlLiteDataSource()
: createPostgresDataSource()
databaseType === DatabaseType.SQLITE3
? createSqlLiteDataSource()
: createPostgresDataSource()

export function APArrayContains<T extends ObjectLiteral>(
columnName: string,
Expand Down
@@ -0,0 +1,71 @@
import { MigrationInterface, QueryRunner } from 'typeorm'

export class AddIssueEntityPostgres1714904516114 implements MigrationInterface {
name = 'AddIssueEntityPostgres1714904516114'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TABLE "issue" (
"id" character varying(21) NOT NULL,
"created" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
"updated" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
"projectId" character varying(21) NOT NULL,
"flowId" character varying(21) NOT NULL,
"status" character varying NOT NULL,
"count" integer NOT NULL,
"lastOccurrence" TIMESTAMP WITH TIME ZONE NOT NULL,
CONSTRAINT "REL_6c7309a7ac3112d264f5d7b49f" UNIQUE ("flowId"),
CONSTRAINT "PK_f80e086c249b9f3f3ff2fd321b7" PRIMARY KEY ("id")
)
`)
await queryRunner.query(`
CREATE UNIQUE INDEX "idx_issue_flow_id" ON "issue" ("flowId")
`)
await queryRunner.query(`
CREATE INDEX "idx_issue_project_id_flow_id" ON "issue" ("projectId", "flowId")
`)
await queryRunner.query(`
ALTER TABLE "platform"
ADD "flowIssuesEnabled" boolean
`)
await queryRunner.query(`
UPDATE "platform"
SET "flowIssuesEnabled" = false
`)
await queryRunner.query(`
ALTER TABLE "platform"
ALTER COLUMN "flowIssuesEnabled" SET NOT NULL
`)

await queryRunner.query(`
ALTER TABLE "issue"
ADD CONSTRAINT "fk_issue_flow_id" FOREIGN KEY ("flowId") REFERENCES "flow"("id") ON DELETE CASCADE ON UPDATE NO ACTION
`)
await queryRunner.query(`
ALTER TABLE "issue"
ADD CONSTRAINT "fk_issue_project_id" FOREIGN KEY ("projectId") REFERENCES "project"("id") ON DELETE CASCADE ON UPDATE RESTRICT
`)
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE "issue" DROP CONSTRAINT "fk_issue_project_id"
`)
await queryRunner.query(`
ALTER TABLE "issue" DROP CONSTRAINT "fk_issue_flow_id"
`)
await queryRunner.query(`
ALTER TABLE "platform" DROP COLUMN "flowIssuesEnabled"
`)
await queryRunner.query(`
DROP INDEX "public"."idx_issue_project_id_flow_id"
`)
await queryRunner.query(`
DROP INDEX "public"."idx_issue_flow_id"
`)
await queryRunner.query(`
DROP TABLE "issue"
`)
}

}