Skip to content

Commit 60cae59

Browse files
author
yalan2ny
authored
Merge pull request #3 from cloudflare/production
y2B/cloudflare
2 parents 27382ce + 0a3b4d8 commit 60cae59

File tree

13,495 files changed

+647331
-514632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

13,495 files changed

+647331
-514632
lines changed

.editorconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ root = true
33

44
[*]
55
indent_size = 2
6-
indent_style = space
6+
indent_style = tab
77
end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = false
1111

12-
[Makefile]
13-
indent_style = tab
12+
[*.{yml,yaml}]
13+
indent_style = space

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Migration from Hugo -> Starlight
2+
abb2df90da1a9d8544ec51f7638b10d007ba45b1

.gitattributes

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*.astro text eol=lf
2+
*.css text eol=lf
3+
*.go text eol=lf
4+
*.html text eol=lf
5+
*.ini text eol=lf
6+
*.js text eol=lf
7+
*.jsx text eol=lf
8+
*.json text eol=lf
9+
*.md text eol=lf
10+
*.mdx text eol=lf
11+
*.mjs text eol=lf
12+
*.svg text eol=lf
13+
*.toml text eol=lf
14+
*.ts text eol=lf
15+
*.tsx text eol=lf
16+
*.txt text eol=lf
17+
*.vue text eol=lf
18+
*.xml text eol=lf
19+
*.yaml text eol=lf
20+
*.yml text eol=lf
21+
__redirects text eol=lf
22+
.editorconfig text eol=lf
23+
.gitattributes text eol=lf
24+
.prettierignore text eol=lf

.gitguardian.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 2
22
secret:
33
ignored-paths:
4-
- 'assets/search.ts'
5-
- 'data/*.yml'
4+
- "assets/search.ts"
5+
- "data/*.yml"

.github/CODEOWNERS

Lines changed: 185 additions & 118 deletions
Large diffs are not rendered by default.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
blank_issues_enabled: false
2+
contact_links:
3+
- name: Issue with your website
4+
url: https://developers.cloudflare.com/support/contacting-cloudflare-support/#methods-of-contacting-cloudflare-support
5+
about: If you need support with your website or Cloudflare applications, please contact Cloudflare through the relevant support channel.
6+
- name: Issue with Cloudflare 5XX errors
7+
url: https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#troubleshooting-cloudflare-5xx-errors--cloudflare-help-center
8+
about: If you are encountering a Cloudflare 5XX error, please read our troubleshooting documentation for 5XX errors.
9+
- name: Issue with Cloudflare Workers
10+
url: https://github.com/cloudflare/workers-sdk/issues/new/choose
11+
about: Issues relating to Cloudflare Workers should be made in the workers-sdk repo.

.github/ISSUE_TEMPLATE/engineering.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Website and/or content display error(s)
2-
description: Report an issue with the live website; for example, issues with content display, buggy browser behavior, etc.
1+
name: Cloudflare docs website error(s)
2+
description: Report an issue with the live documentation website; for example, issues with content display, buggy browser behavior, etc.
33
labels: ["engineering"]
44
assignees:
5-
- kodster28
5+
- KianNH
66
body:
77
- type: textarea
88
id: location-urls
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: 'Assign Issue Owner'
2-
description: 'Assign the issue to its product content owner.'
1+
name: "Assign Issue Owner"
2+
description: "Assign the issue to its product content owner."
33

44
inputs:
55
GITHUB_TOKEN:
6-
description: 'token for repository access'
6+
description: "token for repository access"
77
required: true
88

99
runs:
10-
using: 'node16'
11-
main: 'index.js'
10+
using: "node16"
11+
main: "index.js"

.github/actions/assign-issue/index.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 108 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,116 @@
11
// NOTE: This is the source file!
22
// ~> Run `npm run build` to produce `index.js`
33

4-
import * as core from '@actions/core';
5-
import * as github from '@actions/github';
4+
import * as core from "@actions/core";
5+
import * as github from "@actions/github";
66
import * as codeOwnersUtils from "codeowners-utils";
77

88
// This pulls assignment logic from our codeowners file
99

1010
(async function () {
11-
try {
12-
const token = core.getInput('GITHUB_TOKEN', { required: true });
13-
14-
const payload = github.context.payload;
15-
16-
const { action, repository, issue } = payload;
17-
if (!issue) throw new Error('Missing "issue" object!');
18-
if (!repository) throw new Error('Missing "repository" object!');
19-
if (action !== 'opened') throw new Error('Must be "issues.opened" event!');
20-
21-
// stop here if "engineering" issue
22-
const labels: string[] = (issue.labels || []).map(x => x.name);
23-
if (labels.includes('engineering')) return console.log('ignore "engineering" issues');
24-
25-
// continue for other assignments
26-
let cwd = process.cwd();
27-
let codeowners = await codeOwnersUtils.loadOwners(cwd);
28-
const assignees = new Set<string>();
29-
const content = issue.body;
30-
if (!content) throw new Error('Missing "issue.body" content!');
31-
if (!issue.number) throw new Error('Missing "issue.number" value!');
32-
33-
const regex = /https?:\/\/developers\.cloudflare\.com([^\s|)]*)/gm;
34-
let links = []
35-
let m;
36-
37-
while ((m = regex.exec(content)) !== null) {
38-
// This is necessary to avoid infinite loops with zero-width matches
39-
if (m.index === regex.lastIndex) {
40-
regex.lastIndex++;
41-
}
42-
43-
// The result can be accessed through the `m`-variable.
44-
m.forEach((match, groupIndex) => {
45-
if (groupIndex === 1) {
46-
links.push(match);
47-
}
48-
});
49-
}
50-
51-
console.log("Links are:")
52-
console.log(links);
53-
54-
for (const item of links) {
55-
const updatedLink = "content".concat(item);
56-
console.log("Updated link is:")
57-
console.log(updatedLink);
58-
const match = codeOwnersUtils.matchFile(updatedLink, codeowners);
59-
for (const owner of match.owners) {
60-
if (!owner.includes("/")) {
61-
assignees.add(owner.replace(/^@/, ""));
62-
}
63-
}
64-
}
65-
console.log("Assignees are:")
66-
console.log(assignees);
67-
68-
if (assignees.size === 0) {
69-
assignees.add("kodster28");
70-
}
71-
72-
const client = github.getOctokit(token);
73-
74-
await client.rest.issues.addAssignees({
75-
owner: repository.owner.login,
76-
issue_number: issue.number,
77-
repo: repository.name,
78-
assignees: [...assignees],
79-
});
80-
81-
console.log('Assignees added (if present)')
82-
83-
// Add labels for future reporting
84-
85-
const labelPrefix = 'product:';
86-
const newLabels = new Set<string>();
87-
88-
for (const link of links) {
89-
const parts = link.split('/');
90-
if (parts[1] !== undefined) {
91-
newLabels.add(labelPrefix.concat(parts[1]));
92-
}
93-
}
94-
95-
console.log(newLabels)
96-
97-
if (newLabels.size > 0) {
98-
await client.rest.issues.addLabels({
99-
owner: repository.owner.login,
100-
issue_number: issue.number,
101-
repo: repository.name,
102-
labels: [...newLabels],
103-
});
104-
}
105-
106-
console.log('Labels added')
107-
108-
console.log('DONE~!');
109-
} catch (error) {
110-
core.setFailed(error.message);
111-
}
112-
})();
11+
try {
12+
const token = core.getInput("GITHUB_TOKEN", { required: true });
13+
14+
const payload = github.context.payload;
15+
16+
const { action, repository, issue } = payload;
17+
if (!issue) throw new Error('Missing "issue" object!');
18+
if (!repository) throw new Error('Missing "repository" object!');
19+
if (action !== "opened") throw new Error('Must be "issues.opened" event!');
20+
21+
// stop here if "engineering" issue
22+
const labels: string[] = (issue.labels || []).map((x) => x.name);
23+
if (labels.includes("engineering"))
24+
return console.log('ignore "engineering" issues');
25+
26+
// continue for other assignments
27+
let cwd = process.cwd();
28+
let codeowners = await codeOwnersUtils.loadOwners(cwd);
29+
const assignees = new Set<string>();
30+
const content = issue.body;
31+
if (!content) throw new Error('Missing "issue.body" content!');
32+
if (!issue.number) throw new Error('Missing "issue.number" value!');
33+
34+
const regex = /https?:\/\/developers\.cloudflare\.com([^\s|)]*)/gm;
35+
let links = [];
36+
let m;
37+
38+
while ((m = regex.exec(content)) !== null) {
39+
// This is necessary to avoid infinite loops with zero-width matches
40+
if (m.index === regex.lastIndex) {
41+
regex.lastIndex++;
42+
}
43+
44+
// The result can be accessed through the `m`-variable.
45+
m.forEach((match, groupIndex) => {
46+
if (groupIndex === 1) {
47+
links.push(match);
48+
}
49+
});
50+
}
51+
52+
console.log("Links are:");
53+
console.log(links);
54+
55+
for (const item of links) {
56+
const updatedLink = "src/content/docs".concat(item);
57+
console.log("Updated link is:");
58+
console.log(updatedLink);
59+
const match = codeOwnersUtils.matchFile(updatedLink, codeowners);
60+
for (const owner of match.owners) {
61+
if (!owner.includes("/")) {
62+
assignees.add(owner.replace(/^@/, ""));
63+
}
64+
}
65+
}
66+
console.log("Assignees are:");
67+
console.log(assignees);
68+
69+
if (assignees.size === 0) {
70+
// assign folks which will manually reassign
71+
["haleycode", "pedrosousa", "dcpena", "patriciasantaana"].forEach(
72+
(username) => assignees.add(username),
73+
);
74+
}
75+
76+
const client = github.getOctokit(token);
77+
78+
await client.rest.issues.addAssignees({
79+
owner: repository.owner.login,
80+
issue_number: issue.number,
81+
repo: repository.name,
82+
assignees: [...assignees],
83+
});
84+
85+
console.log("Assignees added (if present)");
86+
87+
// Add labels for future reporting
88+
89+
const labelPrefix = "product:";
90+
const newLabels = new Set<string>();
91+
92+
for (const link of links) {
93+
const parts = link.split("/");
94+
if (parts[1] !== undefined) {
95+
newLabels.add(labelPrefix.concat(parts[1]));
96+
}
97+
}
98+
99+
console.log(newLabels);
100+
101+
if (newLabels.size > 0) {
102+
await client.rest.issues.addLabels({
103+
owner: repository.owner.login,
104+
issue_number: issue.number,
105+
repo: repository.name,
106+
labels: [...newLabels],
107+
});
108+
}
109+
110+
console.log("Labels added");
111+
112+
console.log("DONE~!");
113+
} catch (error) {
114+
core.setFailed(error.message);
115+
}
116+
})();

0 commit comments

Comments
 (0)