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

[Release] Stage to Main #2423

Merged
merged 5 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Those env variables are set by an github action automatically

Check warning on line 1 in .github/workflows/helpers.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override. Raw Output: {"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}
// For local testing, you should test on your fork.
const owner = process.env.REPO_OWNER || ''; // example owner: adobecom
const repo = process.env.REPO_NAME || ''; // example repo name: milo
Expand Down Expand Up @@ -43,15 +43,21 @@
},
];

const isWithinRCP = () => {
const isWithinRCP = (offset = 0) => {
const now = new Date();
if (now.getFullYear() !== CURRENT_YEAR) {
console.log(`ADD NEW RCPs for ${CURRENT_YEAR + 1}`);
return true;
}

if (RCPDates.some(({ start, end }) => start <= now && now <= end)) {
console.log('Current date is within a RCP. Stopping execution.');
if (RCPDates.some(({ start, end }) => {
const adjustedStart = new Date(start);
adjustedStart.setDate(adjustedStart.getDate() - offset);
return start <= now && now <= end
})) {
console.log(
'Current date is within a RCP (2 days earlier for stage, to keep stage clean & make CSO contributions during an RCP easier). Stopping execution.'
);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-to-stage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {

Check warning on line 1 in .github/workflows/merge-to-stage.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override. Raw Output: {"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}
slackNotification,
getLocalConfigs,
isWithinRCP,
Expand Down Expand Up @@ -179,7 +179,7 @@
github = params.github;
owner = params.context.repo.owner;
repo = params.context.repo.repo;
if (isWithinRCP()) return console.log('Stopped, within RCP period.');
if (isWithinRCP(2)) return console.log('Stopped, within RCP period.');

try {
const stageToMainPR = await getStageToMainPR();
Expand Down
66 changes: 37 additions & 29 deletions libs/features/personalization/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,51 +213,59 @@ function createPreviewPill(manifests) {
document.body.dataset.mepHighlight = true;
}

const PREVIEW_BUTTON_ID = 'preview-button';

div.innerHTML = `
<div class="mep-manifest mep-badge">
<span class="mep-open"></span>
<div class="mep-manifest-count">${manifests?.length || 0} Manifest(s) served</div>
</div>
<div class="mep-popup">
<div class="mep-popup-header">
<div>
<h4>${manifests?.length || 0} Manifest(s) served</h4>
<span class="mep-close"></span>
<div class="mep-manifest-page-info-title">Page Info:</div>
<div>Target integration feature is ${targetOnText}</div>
<div>Personalization feature is ${personalizationOnText}</div>
<div>Page's Locale is ${config.locale.ietf}</div>
</div>
</div>
<div class="mep-manifest-list">
<div class="mep-manifest-info">
<div class="mep-manifest-variants">
<input type="checkbox" name="mepHighlight" id="mepHighlightCheckbox" ${mepHighlightChecked} value="true"> <label for="mepHighlightCheckbox">Highlight changes</label>
<div class="mep-popup-header">
<div>
<h4>${manifests?.length || 0} Manifest(s) served</h4>
<span class="mep-close"></span>
<div class="mep-manifest-page-info-title">Page Info:</div>
<div>Target integration feature is ${targetOnText}</div>
<div>Personalization feature is ${personalizationOnText}</div>
<div>Page's Locale is ${config.locale.ietf}</div>
</div>
</div>
${manifestList}
<div class="mep-advanced-container">
<div class="mep-toggle-advanced">Advanced options</div>
<div class="mep-manifest-info mep-advanced-options">
<div>
Optional: new manifest location or path
</div>
<div class="mep-manifest-list">
<div class="mep-manifest-info">
<div class="mep-manifest-variants">
<input type="checkbox" name="mepHighlight" id="mepHighlightCheckbox" ${mepHighlightChecked} value="true"> <label for="mepHighlightCheckbox">Highlight changes</label>
</div>
</div>
${manifestList}
<div class="mep-advanced-container">
<div class="mep-toggle-advanced">Advanced options</div>
<div class="mep-manifest-info mep-advanced-options">
<div>
<input type="text" name="new-manifest" id="new-manifest">
Optional: new manifest location or path
</div>
<div class="mep-manifest-variants">
<div>
<input type="text" name="new-manifest" id="new-manifest">
</div>
</div>
</div>
</div>
<div class="mep-manifest-info">
<div class="mep-manifest-variants mep-advanced-options">
<input type="checkbox" name="mepPreviewButtonCheckbox" id="mepPreviewButtonCheckbox" value="off"> <label for="mepPreviewButtonCheckbox">add mepButton=off to preview link</label>
<div class="mep-manifest-info">
<div class="mep-manifest-variants mep-advanced-options">
<input type="checkbox" name="mepPreviewButtonCheckbox" id="mepPreviewButtonCheckbox" value="off"> <label for="mepPreviewButtonCheckbox">add mepButton=off to preview link</label>
</div>
</div>
</div>
</div>
</div>
<div class="dark">
<a class="con-button outline button-l" href="${simulateHref.href}" title="Preview above choices">Preview</a>
<div class="dark">
<a class="con-button outline button-l" data-id="${PREVIEW_BUTTON_ID}" title="Preview above choices">Preview</a>
</div>
</div>`;

const previewButton = div.querySelector(`a[data-id="${PREVIEW_BUTTON_ID}"]`);

if (previewButton) previewButton.href = simulateHref.href;

overlay.append(div);
addPillEventListeners(div);
}
Expand Down
Loading
Loading