Skip to content

Commit 8284dca

Browse files
committed
Remove unstable/unused Github project support
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
1 parent ceb0d57 commit 8284dca

File tree

15 files changed

+35
-2477
lines changed

15 files changed

+35
-2477
lines changed

services/github/github/src/index.ts

+3-59
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,12 @@
44
import { ActivityMessage, ActivityMessageViewlet } from '@hcengineering/activity'
55
import { Attachment } from '@hcengineering/attachment'
66
import { Person } from '@hcengineering/contact'
7-
import {
8-
Account,
9-
AnyAttribute,
10-
AttachedDoc,
11-
Class,
12-
Data,
13-
Doc,
14-
Hyperlink,
15-
Markup,
16-
Mixin,
17-
Ref,
18-
Timestamp
19-
} from '@hcengineering/core'
7+
import { Account, AttachedDoc, Class, Data, Doc, Hyperlink, Markup, Mixin, Ref, Timestamp } from '@hcengineering/core'
208
import { Asset, IntlString, Metadata, Plugin, plugin } from '@hcengineering/platform'
219
import { Preference } from '@hcengineering/preference'
2210
import task, { ProjectTypeDescriptor, TaskStatusFactory, TaskTypeDescriptor } from '@hcengineering/task'
2311
import { ToDo } from '@hcengineering/time'
24-
import { Component, Issue, Milestone, Project } from '@hcengineering/tracker'
12+
import { Component, Issue, Project } from '@hcengineering/tracker'
2513
import { AnyComponent } from '@hcengineering/ui'
2614
import { PaletteColorIndexes } from '@hcengineering/ui/src/colors'
2715

@@ -456,59 +444,16 @@ export interface GithubUserInfo extends Doc {
456444
avatarUrl?: string
457445
}
458446

459-
/**
460-
* @public
461-
*/
462-
export interface GithubFieldMapping {
463-
// Platform field
464-
_id: Ref<AnyAttribute>
465-
name: string
466-
_class: Ref<Class<Doc>>
467-
468-
// Github information
469-
githubId: string // It could be fieldName or fieldId
470-
}
471-
472-
/**
473-
* @public
474-
*/
475-
export interface GithubProjectSyncData {
476-
// Project NodeId
477-
projectNodeId?: string
478-
projectNumber?: number
479-
480-
githubProjectName?: string
481-
482-
// Mapping of all fields in this project.
483-
mappings: GithubFieldMapping[]
484-
485-
// Update mapping
486-
githubUpdatedAt?: string
487-
}
488-
489447
/**
490448
* @public
491449
*
492450
* Mixin to ordinary project, to allow github repository mapping into it.
493451
*/
494-
export interface GithubProject extends Project, GithubProjectSyncData {
452+
export interface GithubProject extends Project {
495453
integration: Ref<GithubIntegration>
496454

497455
// A list of mapped repositories we synchronized into this project.
498456
repositories: Ref<GithubIntegrationRepository>[]
499-
500-
// Mixin to store all github custom attributes in
501-
mixinClass: Ref<Class<GithubIssue>>
502-
}
503-
504-
/**
505-
* @public
506-
*
507-
* Mixin for milestone to represent a github project for it.
508-
*/
509-
export interface GithubMilestone extends Milestone, GithubProjectSyncData {
510-
// A link to github project.
511-
url: Hyperlink
512457
}
513458

514459
export interface GithubPullRequestReviewThread extends Doc {
@@ -566,7 +511,6 @@ export default plugin(githubId, {
566511
mixin: {
567512
GithubIssue: '' as Ref<Mixin<GithubIssue>>,
568513
GithubProject: '' as Ref<Mixin<GithubProject>>,
569-
GithubMilestone: '' as Ref<Mixin<GithubMilestone>>,
570514
GithubComponent: '' as Ref<Mixin<GithubComponent>>,
571515
GithubUser: '' as Ref<Mixin<GithubUser>>,
572516
GithubTodo: '' as Ref<Mixin<GithubTodo>>

services/github/model-github/src/index.ts

+1-37
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343
import { type Person } from '@hcengineering/contact'
4444
import contact, { TContact } from '@hcengineering/model-contact'
4545
import presentation from '@hcengineering/model-presentation'
46-
import tracker, { TComponent, TIssue, TMilestone, TProject, issuesOptions } from '@hcengineering/model-tracker'
46+
import tracker, { TComponent, TIssue, TProject, issuesOptions } from '@hcengineering/model-tracker'
4747
import view, { classPresenter } from '@hcengineering/model-view'
4848
import workbench from '@hcengineering/model-workbench'
4949
import { getEmbeddedLabel } from '@hcengineering/platform'
@@ -54,11 +54,9 @@ import {
5454
type DocSyncInfo,
5555
type GithubAuthentication,
5656
type GithubComponent,
57-
type GithubFieldMapping,
5857
type GithubIntegration,
5958
type GithubIntegrationRepository,
6059
type GithubIssue,
61-
type GithubMilestone,
6260
type GithubPatch,
6361
type GithubProject,
6462
type GithubPullRequest,
@@ -374,16 +372,6 @@ export class TGithubProject extends TProject implements GithubProject {
374372
@ReadOnly()
375373
@Hidden()
376374
projectNumber!: number
377-
378-
@Prop(TypeRef(core.class.Class), getEmbeddedLabel('Attribute Class'))
379-
@ReadOnly()
380-
@Hidden()
381-
mixinClass!: Ref<Class<GithubIssue>>
382-
383-
@Prop(ArrOf(TypeRecord()), getEmbeddedLabel('Field mappings'))
384-
@Hidden()
385-
// Mapping of all fields in this project.
386-
mappings!: GithubFieldMapping[]
387375
}
388376

389377
@Mixin(github.mixin.GithubIssue, tracker.class.Issue)
@@ -433,29 +421,6 @@ export class TGithubComponent extends TComponent implements GithubComponent {
433421
represent!: boolean
434422
}
435423

436-
@Mixin(github.mixin.GithubMilestone, tracker.class.Milestone)
437-
@UX(github.string.GithubMilestone)
438-
export class TGithubMilestone extends TMilestone implements GithubMilestone {
439-
@Prop(TypeHyperlink(), getEmbeddedLabel('Github Project URL'))
440-
@Index(IndexKind.FullText)
441-
@ReadOnly()
442-
url!: Hyperlink
443-
444-
@Prop(TypeString(), getEmbeddedLabel('NodeID'))
445-
@Hidden()
446-
@ReadOnly()
447-
projectNodeId!: string
448-
449-
@Prop(TypeNumber(), getEmbeddedLabel('Number'))
450-
@Hidden()
451-
@ReadOnly()
452-
projectNumber!: number
453-
454-
@Prop(ArrOf(TypeRecord()), getEmbeddedLabel('Field mappings'))
455-
// Mapping of all fields in this project.
456-
mappings!: GithubFieldMapping[]
457-
}
458-
459424
@Model(github.class.GithubPullRequest, tracker.class.Issue)
460425
@UX(github.string.PullRequest, github.icon.PullRequest, undefined, undefined, undefined, github.string.PullRequests)
461426
export class TGithubPullRequest extends TIssue implements GithubPullRequest {
@@ -603,7 +568,6 @@ export function createModel (builder: Builder): void {
603568
TGithubIntegrationRepository,
604569
TGithubPatch,
605570
TGithubUserInfo,
606-
TGithubMilestone,
607571
TGithubComponent,
608572
TGithubUser,
609573
TGithubTodo

services/github/pod-github/src/sync/comments.ts

-9
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { collectUpdate, deleteObjects, errorToObj, getSince, isGHWriteAllowed }
2929
import { Analytics } from '@hcengineering/analytics'
3030
import { IssueComment, IssueCommentCreatedEvent, IssueCommentEvent } from '@octokit/webhooks-types'
3131
import config from '../config'
32-
import { syncConfig } from './syncConfig'
3332

3433
interface MessageData {
3534
message: string
@@ -89,14 +88,6 @@ export class CommentSyncManager implements DocSyncManager {
8988
if (container === undefined) {
9089
return false
9190
}
92-
if (
93-
container?.container === undefined ||
94-
((container.project.projectNodeId === undefined ||
95-
!container.container.projectStructure.has(container.project._id)) &&
96-
syncConfig.MainProject)
97-
) {
98-
return false
99-
}
10091

10192
const commentExternal = info.external as CommentExternalData | undefined
10293

services/github/pod-github/src/sync/githubTypes.ts

-172
Original file line numberDiff line numberDiff line change
@@ -6,159 +6,6 @@ import {
66
PullRequestMergeable
77
} from '@hcengineering/github'
88

9-
/**
10-
* @public
11-
*/
12-
export type GithubDataType = 'SINGLE_SELECT' | 'TEXT' | 'DATE' | 'NUMBER'
13-
14-
/**
15-
* @public
16-
*/
17-
export interface GithubProjectV2 {
18-
projectV2: {
19-
id: string
20-
title: string
21-
description: string
22-
updatedAt: string
23-
fields: {
24-
edges: GithubProjectV2Field[]
25-
}
26-
}
27-
}
28-
29-
/**
30-
* @public
31-
*/
32-
export interface GithubProjectV2FieldOption {
33-
name: string
34-
color: string
35-
description: string
36-
id: string
37-
}
38-
/**
39-
* @public
40-
*/
41-
export interface GithubProjectV2Field {
42-
node: {
43-
dataType: GithubDataType
44-
updatedAt: string
45-
46-
id: string
47-
name: string
48-
options?: GithubProjectV2FieldOption[]
49-
} & Record<string, any>
50-
}
51-
/**
52-
* @public
53-
*/
54-
export interface GithubProjectV2ItemFieldValue {
55-
id: string
56-
// Date
57-
date?: string
58-
// Number
59-
number?: number
60-
// Single select
61-
color?: string
62-
description?: string
63-
optionId?: string
64-
// Text
65-
text?: string
66-
field: {
67-
id: string
68-
name: string
69-
dataType: GithubDataType
70-
}
71-
}
72-
73-
export interface GithubProjectV2Item {
74-
id: string
75-
type: 'ISSUE' | 'PULL_REQUEST' | 'DRAFT_ISSUE' | 'REDACTED'
76-
project: {
77-
id: string
78-
number: number
79-
}
80-
fieldValues: {
81-
nodes: (GithubProjectV2ItemFieldValue | any)[]
82-
}
83-
}
84-
85-
export const projectV2Field = `
86-
... on ProjectV2Field {
87-
id
88-
name
89-
updatedAt
90-
dataType
91-
}
92-
... on ProjectV2IterationField {
93-
id
94-
name
95-
dataType
96-
updatedAt
97-
}
98-
... on ProjectV2SingleSelectField {
99-
id
100-
name
101-
options {
102-
name
103-
id
104-
color
105-
description
106-
}
107-
dataType
108-
updatedAt
109-
}
110-
`
111-
112-
export const projectV2ItemFields = `
113-
... on ProjectV2ItemFieldDateValue {
114-
id
115-
date
116-
field {
117-
... on ProjectV2Field {
118-
id
119-
name
120-
dataType
121-
}
122-
}
123-
}
124-
... on ProjectV2ItemFieldNumberValue {
125-
id
126-
number
127-
field {
128-
... on ProjectV2Field {
129-
id
130-
name
131-
dataType
132-
}
133-
}
134-
}
135-
... on ProjectV2ItemFieldSingleSelectValue {
136-
id
137-
name
138-
color
139-
description
140-
optionId
141-
field {
142-
... on ProjectV2SingleSelectField {
143-
id
144-
name
145-
dataType
146-
}
147-
}
148-
}
149-
... on ProjectV2ItemFieldTextValue {
150-
id
151-
text
152-
field {
153-
... on ProjectV2Field {
154-
id
155-
name
156-
dataType
157-
}
158-
}
159-
}
160-
`
161-
1629
export const assigneesField = `
16310
assignees(first: 10) {
16411
nodes {
@@ -245,22 +92,6 @@ title
24592
updatedAt
24693
url
24794
${reactionsField}
248-
projectItems(first: 10, includeArchived: true) {
249-
nodes {
250-
id
251-
type
252-
project {
253-
id
254-
url
255-
number
256-
}
257-
fieldValues(first: 50) {
258-
nodes {
259-
${projectV2ItemFields}
260-
}
261-
}
262-
}
263-
}
26495
lastEditedAt
26596
publishedAt
26697
`
@@ -307,9 +138,6 @@ export interface IssueExternalData {
307138
}
308139
}[]
309140
}
310-
projectItems: {
311-
nodes: GithubProjectV2Item[]
312-
}
313141
lastEditedAt: string
314142
publishedAt: string
315143
}

0 commit comments

Comments
 (0)