Skip to content

Add a gulp task for releasing pdf.js in the Firefox git tree - #21777

Merged
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:firefox_target
Aug 15, 2026
Merged

Add a gulp task for releasing pdf.js in the Firefox git tree#21777
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:firefox_target

Conversation

@calixteman

@calixteman calixteman commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Add a gulp task for releasing pdf.js in the Firefox git tree

The output directory is either the env var GECKO_PATH or the argument of --path/-p option.

With the -w option the task keeps watching the source files and releases again on every change.

The mozcentralbaseline and mozcentraldiff tasks are removed since they're superseded by this one: the diff they generate uses the old browser/extensions/pdfjs paths, which no longer exist in mozilla-central, hence it cannot be applied there anymore.

Comment thread gulpfile.mjs Fixed
Comment thread gulpfile.mjs Fixed
@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.17%. Comparing base (b96d745) to head (4c553c2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21777      +/-   ##
==========================================
+ Coverage   90.15%   90.17%   +0.01%     
==========================================
  Files         264      264              
  Lines       67253    67253              
==========================================
+ Hits        60632    60645      +13     
+ Misses       6621     6608      -13     
Flag Coverage Δ
browsertest 66.32% <ø> (-0.01%) ⬇️
fonttest 9.00% <ø> (ø)
integrationtest 69.37% <ø> (+<0.01%) ⬆️
unittest 58.27% <ø> (ø)
unittestcli 56.81% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

Are the following (old) gulp tasks still used, or can they be removed now?

pdf.js/gulpfile.mjs

Lines 3127 to 3206 in b96d745

gulp.task(
"mozcentralbaseline",
gulp.series(createBaseline, function createMozcentralBaseline(done) {
console.log("\n### Creating mozcentral baseline environment");
// Create a mozcentral build.
fs.rmSync(BASELINE_DIR + BUILD_DIR, { recursive: true, force: true });
const workingDirectory = path.resolve(process.cwd(), BASELINE_DIR);
safeSpawnSync("gulp", ["mozcentral"], {
env: process.env,
cwd: workingDirectory,
stdio: "inherit",
});
// Copy the mozcentral build to the mozcentral baseline directory.
fs.rmSync(MOZCENTRAL_BASELINE_DIR, { recursive: true, force: true });
fs.mkdirSync(MOZCENTRAL_BASELINE_DIR, { recursive: true });
gulp
.src([BASELINE_DIR + BUILD_DIR + "mozcentral/**/*"], { encoding: false })
.pipe(gulp.dest(MOZCENTRAL_BASELINE_DIR))
.on("end", function () {
// Commit the mozcentral baseline.
safeSpawnSync("git", ["init"], { cwd: MOZCENTRAL_BASELINE_DIR });
safeSpawnSync("git", ["add", "."], { cwd: MOZCENTRAL_BASELINE_DIR });
safeSpawnSync("git", ["commit", "-m", '"mozcentral baseline"'], {
cwd: MOZCENTRAL_BASELINE_DIR,
});
done();
});
})
);
gulp.task(
"mozcentraldiff",
gulp.series(
"mozcentral",
"mozcentralbaseline",
function createMozcentralDiff(done) {
console.log("\n### Creating mozcentral diff");
// Create the diff between the current mozcentral build and the
// baseline mozcentral build, which both exist at this point.
// Remove all files/folders, except for `.git` because it needs to be a
// valid Git repository for the Git commands below to work.
for (const entry of fs.readdirSync(MOZCENTRAL_BASELINE_DIR)) {
if (entry !== ".git") {
fs.rmSync(MOZCENTRAL_BASELINE_DIR + entry, {
recursive: true,
force: true,
});
}
}
gulp
.src([BUILD_DIR + "mozcentral/**/*"], { encoding: false })
.pipe(gulp.dest(MOZCENTRAL_BASELINE_DIR))
.on("end", function () {
safeSpawnSync("git", ["add", "-A"], { cwd: MOZCENTRAL_BASELINE_DIR });
const diff = safeSpawnSync(
"git",
["diff", "--binary", "--cached", "--unified=8"],
{ cwd: MOZCENTRAL_BASELINE_DIR }
).stdout;
createStringSource(MOZCENTRAL_DIFF_FILE, diff)
.pipe(gulp.dest(BUILD_DIR))
.on("end", function () {
console.log(
"Result diff can be found at " +
BUILD_DIR +
MOZCENTRAL_DIFF_FILE
);
done();
});
});
}
)
);

@calixteman

Copy link
Copy Markdown
Contributor Author

Are the following (old) gulp tasks still used, or can they be removed now?

pdf.js/gulpfile.mjs

Lines 3127 to 3206 in b96d745

gulp.task(
"mozcentralbaseline",
gulp.series(createBaseline, function createMozcentralBaseline(done) {
console.log("\n### Creating mozcentral baseline environment");
// Create a mozcentral build.
fs.rmSync(BASELINE_DIR + BUILD_DIR, { recursive: true, force: true });
const workingDirectory = path.resolve(process.cwd(), BASELINE_DIR);
safeSpawnSync("gulp", ["mozcentral"], {
env: process.env,
cwd: workingDirectory,
stdio: "inherit",
});
// Copy the mozcentral build to the mozcentral baseline directory.
fs.rmSync(MOZCENTRAL_BASELINE_DIR, { recursive: true, force: true });
fs.mkdirSync(MOZCENTRAL_BASELINE_DIR, { recursive: true });
gulp
.src([BASELINE_DIR + BUILD_DIR + "mozcentral/**/*"], { encoding: false })
.pipe(gulp.dest(MOZCENTRAL_BASELINE_DIR))
.on("end", function () {
// Commit the mozcentral baseline.
safeSpawnSync("git", ["init"], { cwd: MOZCENTRAL_BASELINE_DIR });
safeSpawnSync("git", ["add", "."], { cwd: MOZCENTRAL_BASELINE_DIR });
safeSpawnSync("git", ["commit", "-m", '"mozcentral baseline"'], {
cwd: MOZCENTRAL_BASELINE_DIR,
});
done();
});
})
);
gulp.task(
"mozcentraldiff",
gulp.series(
"mozcentral",
"mozcentralbaseline",
function createMozcentralDiff(done) {
console.log("\n### Creating mozcentral diff");
// Create the diff between the current mozcentral build and the
// baseline mozcentral build, which both exist at this point.
// Remove all files/folders, except for `.git` because it needs to be a
// valid Git repository for the Git commands below to work.
for (const entry of fs.readdirSync(MOZCENTRAL_BASELINE_DIR)) {
if (entry !== ".git") {
fs.rmSync(MOZCENTRAL_BASELINE_DIR + entry, {
recursive: true,
force: true,
});
}
}
gulp
.src([BUILD_DIR + "mozcentral/**/*"], { encoding: false })
.pipe(gulp.dest(MOZCENTRAL_BASELINE_DIR))
.on("end", function () {
safeSpawnSync("git", ["add", "-A"], { cwd: MOZCENTRAL_BASELINE_DIR });
const diff = safeSpawnSync(
"git",
["diff", "--binary", "--cached", "--unified=8"],
{ cwd: MOZCENTRAL_BASELINE_DIR }
).stdout;
createStringSource(MOZCENTRAL_DIFF_FILE, diff)
.pipe(gulp.dest(BUILD_DIR))
.on("end", function () {
console.log(
"Result diff can be found at " +
BUILD_DIR +
MOZCENTRAL_DIFF_FILE
);
done();
});
});
}
)
);

Yep they're completely outdated so it doesn't make sense to keep them.

@Snuffleupagus Snuffleupagus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that you've successfully tested this locally.

r=me, with one suggestion and one question.

Comment thread gulpfile.mjs Outdated
Comment thread gulpfile.mjs Outdated
The output directory is either the env var GECKO_PATH or the argument of --path/-p option.

With the -w option the task keeps watching the source files and releases
again on every change.

The mozcentralbaseline and mozcentraldiff tasks are removed since they're
superseded by this one: the diff they generate uses the old
browser/extensions/pdfjs paths, which no longer exist in mozilla-central,
hence it cannot be applied there anymore.
@calixteman
calixteman merged commit ca17005 into mozilla:master Aug 15, 2026
21 checks passed
@calixteman
calixteman deleted the firefox_target branch August 15, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants