Skip to content

Commit 3223eb6

Browse files
committed
feat: add CNCF event link
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent 3290818 commit 3223eb6

File tree

8 files changed

+246
-112
lines changed

8 files changed

+246
-112
lines changed
Lines changed: 116 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,120 @@
1-
name: Meetup
2-
description: Gather meetup event organization data
3-
title: "[Meetup]"
4-
labels:
5-
- meetup
6-
body:
7-
- type: input
8-
id: event_title
9-
attributes:
10-
label: Event Title
11-
description: Provide the title of the event
12-
placeholder: Enter the event title
13-
- type: input
14-
id: event_date
15-
attributes:
16-
label: Event date
17-
description: |
18-
Specify the proposed date for the event.
19-
Format: YYYY-MM-DD
20-
placeholder: YYYY-MM-DD
21-
- type: dropdown
22-
id: hoster
23-
attributes:
24-
label: Hosting
25-
description: Pick a hoster
26-
options:
27-
- EasyPartner
28-
- Sept Lieues
29-
- Axians Communication & Cloud Aix
30-
- FGTECH
31-
- Softway medical
32-
- Free Pro
33-
- La Briqueterie
34-
- Devoteam
35-
- SmartTribune
36-
- OnePoint
37-
- Linxo
38-
- Squad
39-
- Doinsport
40-
- Numbr Marseille
41-
- La plateforme
42-
- Smile
43-
- TheCamp
44-
- type: textarea
45-
id: event_description
46-
attributes:
47-
label: Event Description
48-
description: Short describe the event
49-
- type: textarea
50-
id: agenda
51-
attributes:
52-
label: Agenda
53-
description: Outline the schedule and topics to be discussed
54-
placeholder: |
55-
- <speaker_1>: <talk_description_1>
56-
- <speaker_2>: <talk_description_2>
57-
- type: input
58-
id: meetup_link
59-
attributes:
60-
label: Meetup Link
61-
description: Provide the link to the Meetup event page
62-
placeholder: https://www.meetup.com/fr-FR/devops-aix-marseille/events/xxxxxxx
63-
- type: input
64-
id: drive_link
65-
attributes:
66-
label: Drive Link
67-
description: Provide the link to the Google Drive folder
68-
placeholder: https://drive.google.com/drive/folders/xxxxxxxxxxxxxxxxxxxx
69-
- type: checkboxes
70-
id: slides
71-
attributes:
72-
label: Slides & Content
73-
description: Check items for slides and event content
74-
options:
75-
- label: Basic Slides
76-
- label: Announcements / surveys / news etc...
77-
- label: Slides hosting
78-
- label: Slides speaker(s)
79-
- label: Kahoot / Game
80-
- type: checkboxes
81-
id: communication
82-
attributes:
83-
label: Communication
84-
description: Select communication items to be prepared
85-
options:
86-
- label: Announcement
87-
- label: Cover image
88-
- label: Social networks
89-
- label: Goodies
90-
- type: dropdown
91-
id: aperitif
92-
attributes:
93-
label: Aperitif
94-
description: To be provided?
95-
options:
1+
"name": "Meetup"
2+
"description": "Gather meetup event organization data"
3+
"title": "[Meetup]"
4+
"labels":
5+
- "meetup"
6+
"body":
7+
- "type": "input"
8+
"id": "event_title"
9+
"attributes":
10+
"label": "Event Title"
11+
"description": "Provide the title of the event"
12+
"placeholder": "Enter the event title"
13+
- "type": "input"
14+
"id": "event_date"
15+
"attributes":
16+
"label": "Event date"
17+
"description": "Specify the proposed date for the event.
18+
19+
Format: YYYY-MM-DD\n"
20+
"placeholder": "YYYY-MM-DD"
21+
- "type": "dropdown"
22+
"id": "hoster"
23+
"attributes":
24+
"label": "Hosting"
25+
"description": "Pick a hoster"
26+
"options":
27+
- "Hoster 1"
28+
- "Hoster 2"
29+
- "type": "textarea"
30+
"id": "event_description"
31+
"attributes":
32+
"label": "Event Description"
33+
"description": "Short describe the event"
34+
- "type": "markdown"
35+
"attributes":
36+
"value": "<!-- Available speakers -->
37+
38+
<!--
39+
40+
Speaker One; Speaker Two
41+
42+
-->"
43+
- "type": "textarea"
44+
"id": "agenda"
45+
"attributes":
46+
"label": "Agenda"
47+
"description": "Outline the schedule and topics to be discussed"
48+
"placeholder": "- <speaker_1>: <talk_description_1>
49+
50+
- <speaker_2>: <talk_description_2>\n"
51+
- "type": "input"
52+
"id": "meetup_link"
53+
"attributes":
54+
"label": "Meetup Link"
55+
"description": "Provide the link to the Meetup event page"
56+
"placeholder": "https://www.meetup.com/fr-FR/devops-aix-marseille/events/xxxxxxx"
57+
- "type": "input"
58+
"id": "cncf_link"
59+
"attributes":
60+
"label": "CNCF Link"
61+
"description": "Provide the link to the CNCF event page"
62+
"placeholder": "https://community.cncf.io/events/details/cncf-cloud-native-aix-marseille-presents-xxx"
63+
- "type": "input"
64+
"id": "drive_link"
65+
"attributes":
66+
"label": "Drive Link"
67+
"description": "Provide the link to the Google Drive folder"
68+
"placeholder": "https://drive.google.com/drive/folders/xxxxxxxxxxxxxxxxxxxx"
69+
- "type": "checkboxes"
70+
"id": "slides"
71+
"attributes":
72+
"label": "Slides & Content"
73+
"description": "Check items for slides and event content"
74+
"options":
75+
- "label": "Cover image"
76+
- "label": "Basic Slides"
77+
- "label": "Announcements / surveys / news etc..."
78+
- "label": "Slides hosting"
79+
- "label": "Slides speaker(s)"
80+
- "label": "Kahoot / Game"
81+
- "label": "Openfeedback"
82+
- "label": "Goodies"
83+
- "type": "checkboxes"
84+
"id": "communication"
85+
"attributes":
86+
"label": "Communication"
87+
"description": "Select communication items to be prepared"
88+
"options":
89+
- "label": "Announcement"
90+
- "label": "Cover image"
91+
- "label": "Slack - AixMarseille.Tech"
92+
- "label": "Slack - OpenBaR"
93+
- "label": "LinkedIn"
94+
- "label": "BlueSky"
95+
- "type": "dropdown"
96+
"id": "aperitif"
97+
"attributes":
98+
"label": "Aperitif"
99+
"description": "To be provided?"
100+
"options":
96101
- "Yes"
97102
- "No"
98-
- type: dropdown
99-
id: restaurant
100-
attributes:
101-
label: Restaurant / Bar
102-
description: Afterwards?
103-
options:
103+
- "type": "dropdown"
104+
"id": "restaurant"
105+
"attributes":
106+
"label": "Restaurant / Bar"
107+
"description": "Afterwards?"
108+
"options":
104109
- "Yes"
105110
- "No"
106-
- type: checkboxes
107-
id: post-event
108-
attributes:
109-
label: Post event
110-
description: Select Post event items to be done
111-
options:
112-
- label: Thanks hoster
113-
- label: Thanks speakers
114-
- label: Share slides to meetup
115-
- label: Social networks
111+
- "type": "checkboxes"
112+
"id": "post-event"
113+
"attributes":
114+
"label": "Post event"
115+
"description": "Select Post event items to be done"
116+
"options":
117+
- "label": "Thanks hoster"
118+
- "label": "Thanks speakers"
119+
- "label": "Share slides to Meetup"
120+
- "label": "Social networks"

dist/index.js

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export function getHostersFixture(): [string, ...string[]] {
2-
return ["hoster 1", "hoster 2"];
2+
return ["Hoster 1", "Hoster 2"];
33
}

src/__fixtures__/meetup-issue.fixture.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export function getMeetupIssueFixture(override?: Partial<MeetupIssue>): MeetupIs
1616
event_description: "Description",
1717
agenda: `- ${speakers[0]}: Talk description One\n- ${speakers[1]}: Talk description Two`,
1818
meetup_link: "https://www.meetup.com/fr-FR/devops-aix-marseille/events/123456789",
19+
cncf_link:
20+
"https://community.cncf.io/events/details/cncf-cloud-native-aix-marseille-presents-quiz-conteneurs-et-observabilite",
1921
drive_link: "https://drive.google.com/drive/folders/1a2b3c4d5e6f7g8h9i0j",
2022
...(override?.body ?? {}),
2123
},

src/container.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { HosterLinterAdapter } from "./linter/adapter/hoster-linter.adapter";
1414
import { AgendaLinterAdapter } from "./linter/adapter/agenda-linter.adapter";
1515
import { MeetupLinkLinterAdapter } from "./linter/adapter/meetup-link-linter.adapter";
1616
import { DriveLinkLinterAdapter } from "./linter/adapter/drive-link-linter.adapter";
17+
import { CNCFLinkLinterAdapter } from "./linter/adapter/cncf-link-linter.adapter";
1718

1819
const container = new Container();
1920

@@ -33,6 +34,7 @@ container.bind<LinterAdapter>(LINTER_ADAPTER_IDENTIFIER).to(HosterLinterAdapter)
3334
container.bind<LinterAdapter>(LINTER_ADAPTER_IDENTIFIER).to(EventDescriptionLinterAdapter);
3435
container.bind<LinterAdapter>(LINTER_ADAPTER_IDENTIFIER).to(AgendaLinterAdapter);
3536
container.bind<LinterAdapter>(LINTER_ADAPTER_IDENTIFIER).to(MeetupLinkLinterAdapter);
37+
container.bind<LinterAdapter>(LINTER_ADAPTER_IDENTIFIER).to(CNCFLinkLinterAdapter);
3638
container.bind<LinterAdapter>(LINTER_ADAPTER_IDENTIFIER).to(DriveLinkLinterAdapter);
3739

3840
export { container };
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { CNCFLinkLinterAdapter } from "./cncf-link-linter.adapter";
2+
import { LintError } from "../lint.error";
3+
import { getMeetupIssueFixture } from "../../__fixtures__/meetup-issue.fixture";
4+
5+
describe("CNCFLinkLinterAdapter", () => {
6+
let cncfLinkLinterAdapter: CNCFLinkLinterAdapter;
7+
8+
beforeEach(() => {
9+
cncfLinkLinterAdapter = new CNCFLinkLinterAdapter();
10+
});
11+
12+
describe("lint", () => {
13+
it("should return the cncf issue if the CNCF link is valid", async () => {
14+
// Arrange
15+
const meetupIssue = getMeetupIssueFixture();
16+
const shouldFix = false;
17+
18+
// Act
19+
const result = await cncfLinkLinterAdapter.lint(meetupIssue, shouldFix);
20+
21+
// Assert
22+
expect(result).toEqual(meetupIssue);
23+
});
24+
25+
it("should throw a LintError if the CNCF link is invalid", async () => {
26+
// Arrange
27+
const invalidmeetupIssue = getMeetupIssueFixture({
28+
body: {
29+
cncf_link: "invalid-link",
30+
},
31+
});
32+
const shouldFix = false;
33+
34+
// Act & Assert
35+
const expectedError = new LintError([
36+
"CNCF Link: Invalid url; Must be a valid CNCF link, e.g. https://community.cncf.io/events/details/cncf-cloud-native-aix-marseille-presents-quiz-conteneurs-et-observabilite",
37+
]);
38+
39+
await expect(cncfLinkLinterAdapter.lint(invalidmeetupIssue, shouldFix)).rejects.toStrictEqual(
40+
expectedError
41+
);
42+
});
43+
44+
it("should throw a LintError if the CNCF link is not a CNCF link", async () => {
45+
// Arrange
46+
const invalidmeetupIssue = getMeetupIssueFixture({
47+
body: {
48+
cncf_link: "https://www.google.com",
49+
},
50+
});
51+
const shouldFix = false;
52+
53+
// Act & Assert
54+
const expectedError = new LintError([
55+
"CNCF Link: Must be a valid CNCF link, e.g. https://community.cncf.io/events/details/cncf-cloud-native-aix-marseille-presents-quiz-conteneurs-et-observabilite",
56+
]);
57+
58+
await expect(cncfLinkLinterAdapter.lint(invalidmeetupIssue, shouldFix)).rejects.toStrictEqual(
59+
expectedError
60+
);
61+
});
62+
});
63+
});

0 commit comments

Comments
 (0)