Skip to content

Commit f7f3432

Browse files
authored
Merge branch 'canary' into ijjk/migrate-web-server-cont
2 parents fc65ccd + 8b39060 commit f7f3432

File tree

290 files changed

+23598
-14892
lines changed

Some content is hidden

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

290 files changed

+23598
-14892
lines changed

.github/labeler.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
{ "type": "user", "pattern": "ijjk" },
6060
{ "type": "user", "pattern": "lazarv" },
6161
{ "type": "user", "pattern": "lubieowoce" },
62+
{ "type": "user", "pattern": "nebrelbug" },
6263
{ "type": "user", "pattern": "RobPruzan" },
6364
{ "type": "user", "pattern": "samcx" },
6465
{ "type": "user", "pattern": "sebmarkbage" },

.github/workflows/test_e2e_deploy_release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,42 @@ jobs:
110110
- id: test-result
111111
name: Set test result variable
112112
run: echo 'immediately-close=${{ needs.test-deploy.result != 'success' && 'true' || 'false' }}' >> "$GITHUB_OUTPUT"
113+
- name: Check token
114+
run: gh auth status
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
117+
- uses: actions/github-script@v7
118+
name: Check if target workflow is enabled
119+
id: check-workflow-enabled
120+
with:
121+
retries: 3
122+
retry-exempt-status-codes: 400,401,404
123+
github-token: ${{ secrets.GH_UPDATE_NEXT_WORKFLOW_TRIGGER }}
124+
result-encoding: string
125+
script: |
126+
try {
127+
const response = await github.request(
128+
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}",
129+
{
130+
owner: "vercel",
131+
repo: "front",
132+
workflow_id: "cron-update-next.yml",
133+
}
134+
);
135+
136+
const isEnabled = response.data.state === 'active';
137+
console.info(`Target workflow state: ${response.data.state}`);
138+
console.info(`Target workflow enabled: ${isEnabled}`);
139+
140+
return isEnabled ? 'true' : 'false';
141+
} catch (error) {
142+
console.error('Error checking workflow status:', error);
143+
return 'false';
144+
}
113145
- uses: actions/github-script@v7
114146
name: Trigger vercel/front sync
115147
id: trigger-front-sync
148+
if: steps.check-workflow-enabled.outputs.result == 'true'
116149
with:
117150
retries: 3
118151
retry-exempt-status-codes: 400,401,404

crates/napi/src/next_api/endpoint.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use turbo_tasks::{Completion, Effects, OperationVc, ReadRef, Vc};
1515
use turbopack_core::{diagnostics::PlainDiagnostic, error::PrettyPrintError, issue::PlainIssue};
1616

1717
use super::utils::{
18-
NapiDiagnostic, NapiIssue, RootTask, TurbopackResult, VcArc,
18+
DetachedVc, NapiDiagnostic, NapiIssue, RootTask, TurbopackResult,
1919
strongly_consistent_catch_collectables, subscribe,
2020
};
2121

@@ -86,10 +86,10 @@ impl From<Option<EndpointOutputPaths>> for NapiWrittenEndpoint {
8686
// some async functions (in this case `endpoint_write_to_disk`) can cause
8787
// higher-ranked lifetime errors. See https://github.com/rust-lang/rust/issues/102211
8888
// 2. the type_complexity clippy lint.
89-
pub struct ExternalEndpoint(pub VcArc<OptionEndpoint>);
89+
pub struct ExternalEndpoint(pub DetachedVc<OptionEndpoint>);
9090

9191
impl Deref for ExternalEndpoint {
92-
type Target = VcArc<OptionEndpoint>;
92+
type Target = DetachedVc<OptionEndpoint>;
9393

9494
fn deref(&self) -> &Self::Target {
9595
&self.0
@@ -125,9 +125,10 @@ async fn get_written_endpoint_with_issues_operation(
125125
pub async fn endpoint_write_to_disk(
126126
#[napi(ts_arg_type = "{ __napiType: \"Endpoint\" }")] endpoint: External<ExternalEndpoint>,
127127
) -> napi::Result<TurbopackResult<NapiWrittenEndpoint>> {
128-
let turbo_tasks = endpoint.turbo_tasks().clone();
129128
let endpoint_op = ***endpoint;
130-
let (written, issues, diags) = turbo_tasks
129+
let (written, issues, diags) = endpoint
130+
.turbopack_ctx()
131+
.turbo_tasks()
131132
.run_once(async move {
132133
let written_entrypoint_with_issues_op =
133134
get_written_endpoint_with_issues_operation(endpoint_op);
@@ -158,10 +159,10 @@ pub fn endpoint_server_changed_subscribe(
158159
issues: bool,
159160
func: JsFunction,
160161
) -> napi::Result<External<RootTask>> {
161-
let turbo_tasks = endpoint.turbo_tasks().clone();
162+
let turbopack_ctx = endpoint.turbopack_ctx().clone();
162163
let endpoint = ***endpoint;
163164
subscribe(
164-
turbo_tasks,
165+
turbopack_ctx,
165166
func,
166167
move || {
167168
async move {
@@ -247,10 +248,10 @@ pub fn endpoint_client_changed_subscribe(
247248
#[napi(ts_arg_type = "{ __napiType: \"Endpoint\" }")] endpoint: External<ExternalEndpoint>,
248249
func: JsFunction,
249250
) -> napi::Result<External<RootTask>> {
250-
let turbo_tasks = endpoint.turbo_tasks().clone();
251+
let turbopack_ctx = endpoint.turbopack_ctx().clone();
251252
let endpoint_op = ***endpoint;
252253
subscribe(
253-
turbo_tasks,
254+
turbopack_ctx,
254255
func,
255256
move || {
256257
async move {

crates/napi/src/next_api/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pub mod endpoint;
22
pub mod project;
3+
pub mod turbopack_ctx;
34
pub mod utils;

0 commit comments

Comments
 (0)