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

New gel docs #8295

Merged
merged 115 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
0d51497
Add `edb::env-switcher`, `edb::split-section` and `edb::split-point` …
jaclarke Feb 4, 2025
dfeefa0
Add index directives for keywords, symbols, sql equivalents, etc. in …
jaclarke Jan 30, 2025
4972a8a
Add docs preview deploys (#8289)
jaclarke Feb 4, 2025
d1d519f
Fix deploy failed message
jaclarke Feb 4, 2025
e7e22ae
Fix indentation in string docs
jaclarke Feb 4, 2025
5371395
Allow any type of content on right side of split pages
jaclarke Feb 5, 2025
f2d931e
Move JS/Python/Go docs into the core
1st1 Feb 7, 2025
51fa552
Update docs site deployment branch
jaclarke Feb 8, 2025
7253306
Return errors from script if deployment fails
jaclarke Feb 8, 2025
0d443b5
docs: Move guides/cloud -> cloud
1st1 Feb 13, 2025
c0334f5
Implement basic Sphinx subsitution |Gel| -> node to custom render
1st1 Feb 14, 2025
ec25e2f
Replace EdgeDB->Gel in all :edb-alt-title:
1st1 Feb 14, 2025
371811f
Fix docs/tests to go green
1st1 Feb 14, 2025
976b384
Get rid of trailing whitespace for good
1st1 Feb 14, 2025
d71d1c1
Get rid of weird unicode ' symbols
1st1 Feb 14, 2025
db56e4c
Massive (yet careful) rename EdgeDB -> Gel
1st1 Feb 14, 2025
3653ad9
Rename ``.esdl`` -> |.gel|
1st1 Feb 14, 2025
6709488
Rename ``edgedb.toml`` to |gel.toml|
1st1 Feb 14, 2025
3fbfcb1
``edgedb`` -> |gelcmd|
1st1 Feb 14, 2025
26ad42c
Kill links to (temporarily) Easy EdgeDB and Live Tutorial
1st1 Feb 14, 2025
0b407dd
Make doc test stricter; fix bug
1st1 Feb 14, 2025
7206ca9
Add a custom role for inline '$ gel ..' commands
1st1 Feb 14, 2025
c3591f0
Start using :gelcmd:
1st1 Feb 14, 2025
5b74b9f
Fix what's new 6
1st1 Feb 14, 2025
5a9f372
Use :gelcmd: in more places
1st1 Feb 14, 2025
eeca2f7
Replacing some ``edgedb ...`` with :gelcmd:...
1st1 Feb 14, 2025
f724c7b
Update some guides
1st1 Feb 14, 2025
fb4b64c
Another batch of updates
1st1 Feb 14, 2025
0c309c7
Another round of EdgeDB -> |Gel|
1st1 Feb 14, 2025
2c585cc
Enable |Gel's| substitution
1st1 Feb 14, 2025
d37a39c
Gel's -> |Gel's|
1st1 Feb 14, 2025
5d7783a
More renames
1st1 Feb 15, 2025
d6342ae
'gel watch'
1st1 Feb 15, 2025
37724d5
More edgedb commands -> gel
1st1 Feb 15, 2025
7e1b1ee
More changes
1st1 Feb 15, 2025
8287fb4
edgedb> -> gel>
1st1 Feb 15, 2025
c652d42
edgedb error: -> gel error:
1st1 Feb 15, 2025
cf7f110
Drop Phoenix tutorial (per nik's suggestion)
1st1 Feb 15, 2025
dfd4908
Start renaming references
1st1 Feb 15, 2025
3d7214c
More refs
1st1 Feb 15, 2025
2a976eb
an |Gel| -> a |Gel|
1st1 Feb 15, 2025
de92474
"$ edgedb" -> "$ gel"
1st1 Feb 15, 2025
f87062f
More renames
1st1 Feb 15, 2025
4248fcd
@edgedb -> @gel
1st1 Feb 15, 2025
188af81
Fix another ref name
1st1 Feb 15, 2025
760ebc1
edgedb-auth-token, edgedb-pkce-verifier -> gel
1st1 Feb 15, 2025
64b237c
More renames
1st1 Feb 15, 2025
b89be49
"$ edgedb" -> "$ gel"
1st1 Feb 15, 2025
79a92f4
Handle .esdl transition
1st1 Feb 15, 2025
48fa57c
More changes
1st1 Feb 15, 2025
2cd8e17
github link renames
1st1 Feb 15, 2025
3ae8578
Another batch of renames
1st1 Feb 15, 2025
ceba0f5
More renames
1st1 Feb 15, 2025
0550c2d
More renames
1st1 Feb 15, 2025
486c79b
More renames
1st1 Feb 15, 2025
23be13e
More renames -- almost there
1st1 Feb 15, 2025
00fe436
More renames
1st1 Feb 15, 2025
5a5fa77
Kill Java
1st1 Feb 15, 2025
cc0caaa
Rename X-Gel-User back to X-EdgeDB-User
1st1 Feb 15, 2025
54ea2b9
Bulk-rename ``EDGEDB_NAME`` to :gelenv:`NAME`
1st1 Feb 15, 2025
6e92723
More inline ENV vars renames
1st1 Feb 15, 2025
776dac0
More environment variables renamed
1st1 Feb 15, 2025
2f39a60
More env var renames
1st1 Feb 15, 2025
c7c1c0c
Remaining env vars renamed
1st1 Feb 15, 2025
ed7d77f
Rename CLI rest filed from edgedb_* to gel_*
1st1 Feb 15, 2025
d0ec6eb
Add redirects file
1st1 Feb 15, 2025
975d912
Rename edgedb_toml.rst to gel_toml.rst
1st1 Feb 15, 2025
56a438a
Update CLI curl URL to new scheme
1st1 Feb 15, 2025
b8c091c
Commit forgotten new gel_toml.rst
1st1 Feb 15, 2025
d3f23cc
Kill versionchanged:_default versioning
1st1 Feb 15, 2025
a313d95
Kill debug
1st1 Feb 15, 2025
d4388e9
Drop all :version-lt: snippets
1st1 Feb 15, 2025
a6c3b48
Some branches<>databases footwork
1st1 Feb 15, 2025
4126b1b
Cleanup version_added < 5
1st1 Feb 15, 2025
7d73a53
Kill :versionreplace:
1st1 Feb 19, 2025
3e06ccf
Refactor Indexes
1st1 Feb 15, 2025
a60c858
Refactor functions
1st1 Feb 15, 2025
b29e73e
Refactor modules
1st1 Feb 15, 2025
9e3ecb0
Unify triggers
1st1 Feb 15, 2025
1a385f5
Merge constraints
1st1 Feb 16, 2025
7f72a5a
Merge annotations
1st1 Feb 16, 2025
e3c7f62
Merge links
1st1 Feb 16, 2025
f28319e
Add a clarification about DDL commands
1st1 Feb 16, 2025
e23c8fd
Merge extensions
1st1 Feb 16, 2025
1a01d5c
Merge access policies
1st1 Feb 16, 2025
9e1cdc3
Fix up links. OK, I'm not trusting LLMs anymore.
1st1 Feb 17, 2025
de837cc
Fix up constraints
1st1 Feb 17, 2025
6d5926f
Refactor aliases
1st1 Feb 17, 2025
bab1a40
Merge mutation rewrites
1st1 Feb 19, 2025
5d73164
Upgrade and merge the "Future behavior" section
1st1 Feb 19, 2025
7cb1501
Kill 3.0 syntax from SDL/index (it's covered in what's new)
1st1 Feb 19, 2025
9389284
Merge globals
1st1 Feb 19, 2025
8111aff
Merge primitives/scalars
1st1 Feb 19, 2025
c0ba8a0
Merge objects
1st1 Feb 19, 2025
8c841be
Quickstart tutorial with Next.js (#8269)
scotttrinh Feb 19, 2025
8e53bd5
Upload restructured AI docs (#8345)
deepbuzin Feb 19, 2025
601b209
Upload the tutorial for the FastAPI search bot (#8314)
deepbuzin Feb 19, 2025
968db93
cqa
scotttrinh Feb 19, 2025
6a24949
Fix nested lists
scotttrinh Feb 19, 2025
07850e9
Update for missing or moved docs
scotttrinh Feb 19, 2025
5d89a95
Add Search Bot tutorial to index
scotttrinh Feb 19, 2025
5cf44dd
Implement linting against using ``gel...`` for gel cmd line
1st1 Feb 19, 2025
ed6ff7a
Properties & link properties
1st1 Feb 19, 2025
41137e9
Kill reference/sdl
1st1 Feb 20, 2025
a368f69
New home for migrations
1st1 Feb 20, 2025
ab49c90
Kill old -> syntax from synopses
1st1 Feb 20, 2025
7252082
Move Next.js Quickstart into an env-switcher (#8350)
scotttrinh Feb 20, 2025
3a9b559
Drop reference/ddl
1st1 Feb 20, 2025
e35ac1d
Refactor branches
1st1 Feb 20, 2025
2c4bfd6
Kill 'eql:section-intro-page', fix rest docs
1st1 Feb 20, 2025
84d1e80
Document ReST substitutions
1st1 Feb 20, 2025
cee9861
Docs remove custom intro pages (#8358)
jaclarke Feb 20, 2025
5e65220
cqa: Fix trailing whitespace
scotttrinh Feb 20, 2025
d734944
Add FastAPI quickstart (#8347)
beerose Feb 20, 2025
b35e369
Switch the preview-deploy branch to edgedb.com:master
1st1 Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
191 changes: 191 additions & 0 deletions .github/scripts/docs/preview-deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
const DOCS_SITE_REPO = {
org: "edgedb",
repo: "edgedb.com",
ref: "master",
};

module.exports = async ({ github, context }) => {
const { VERCEL_TOKEN, VERCEL_TEAM_ID } = process.env;

if (!VERCEL_TOKEN || !VERCEL_TEAM_ID) {
throw new Error(
`cannot run docs preview deploy workflow, ` +
`VERCEL_TOKEN or VERCEL_TEAM_ID secrets are missing`
);
}

const prBranch = context.payload.pull_request.head.ref;
const commitSHA = context.payload.pull_request.head.sha;
const shortCommitSHA = commitSHA.slice(0, 8);

const existingComments = (
await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
).data;

const commentHeader = `### Docs preview deploy\n`;
let commentMessage = commentHeader;

let updateComment = existingComments.find(
(c) =>
c.performed_via_github_app?.slug === "github-actions" &&
c.body?.startsWith(commentHeader)
);

let deploymentError = null;
let deployment;
try {
deployment = await vercelFetch("https://api.vercel.com/v13/deployments", {
name: "edgedb-docs",
gitSource: {
type: "github",
...DOCS_SITE_REPO,
},
projectSettings: {
buildCommand: `EDGEDB_REPO_BRANCH=${prBranch} EDGEDB_REPO_SHA=${commitSHA} yarn vercel-build`,
},
});

commentMessage += `\n🔄 Deploying docs preview for commit ${shortCommitSHA}:\n\n<https://${deployment.url}>`;
} catch (e) {
deploymentError = e;
commentMessage += `\n❌ Failed to deploy docs preview for commit ${shortCommitSHA}:\n\n\`\`\`\n${e.message}\n\`\`\``;
}

commentMessage += `\n\n(Last updated: ${formatDatetime(new Date())})`;

if (updateComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: updateComment.id,
body: commentMessage,
});
} else {
updateComment = (
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: commentMessage,
})
).data;
}

if (deploymentError) {
throw new Error(`Docs preview deployment failed: ${e.message}`);
}

let i = 0;
while (i < 40) {
await sleep(15_000);
i++;

const status = (
await vercelFetch(
`https://api.vercel.com/v13/deployments/${deployment.id}`
)
).status;

const latestComment = await github.rest.issues.getComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: updateComment.id,
});

if (!latestComment.data.body.includes(shortCommitSHA)) {
console.log("Skipping further updates, new deployment has started");
return;
}

if (status === "READY" || status === "ERROR" || status === "CANCELED") {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: updateComment.id,
body: `${commentHeader}${
status === "READY"
? `\n✅ Successfully deployed docs preview for commit ${shortCommitSHA}:`
: `\n❌ Docs preview deployment ${
status === "CANCELED" ? "was canceled" : "failed"
} for commit ${shortCommitSHA}:`
}\n\n<https://${deployment.url}>\n\n(Last updated: ${formatDatetime(
new Date()
)})`,
});
if (status !== "READY") {
throw new Error(
`Docs preview deployment failed with status ${status}: https://${deployment.url}`
);
}
return;
}
}

await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: updateComment.id,
body: `${commentHeader}
❌ Timed out waiting for deployment status to succeed or fail for commit ${shortCommitSHA}:\n\n<https://${
deployment.url
}>\n\n(Last updated: ${formatDatetime(new Date())})`,
});
throw new Error("Timed out waiting for deployment status to succeed or fail");
};

async function vercelFetch(url, body) {
const { VERCEL_TOKEN, VERCEL_TEAM_ID } = process.env;
const _url = new URL(url);
url = `${_url.origin}${_url.pathname}?${new URLSearchParams({
teamId: VERCEL_TEAM_ID,
})}`;

let res;
try {
res = await fetch(url, {
body: body ? JSON.stringify(body) : undefined,
headers: {
Authorization: `Bearer ${VERCEL_TOKEN}`,
"Content-Type": body ? "application/json" : undefined,
},
method: body ? "post" : "get",
});
} catch (e) {
throw new Error(`vercel api request failed: ${e}`);
}

if (res.ok) {
return await res.json();
} else {
let body;
try {
body = await res.text();
} catch (e) {
// ignore
}
throw new Error(
`vercel api request failed: ${res.status} ${res.statusText}, ${body}`
);
}
}

function formatDatetime(date) {
return date.toLocaleString("en-US", {
year: "numeric",
month: "short",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric",
hourCycle: "h24",
timeZoneName: "short",
});
}

function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}
21 changes: 21 additions & 0 deletions .github/workflows/docs-preview-deploy.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading