Skip to content

Commit

Permalink
Merge branch 'stage' of github.com:adobecom/milo into ccd
Browse files Browse the repository at this point in the history
  • Loading branch information
yesil committed Dec 9, 2024
2 parents dc0f9c7 + 9884681 commit 1c86cc2
Show file tree
Hide file tree
Showing 29 changed files with 499 additions and 123 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ const RCPDates = [
},
];

const isWithinRCP = (offset = 0) => {
const isShortRCP = (start, end) => {
return ((end - start) / (1000 * 60 * 60)) < 24;
};

const isWithinRCP = ({ offset = 0, excludeShortRCP = false } = {}) => {
const now = new Date();
if (now.getFullYear() !== CURRENT_YEAR) {
console.log(`ADD NEW RCPs for ${CURRENT_YEAR + 1}`);
Expand All @@ -53,7 +57,9 @@ const isWithinRCP = (offset = 0) => {
if (RCPDates.some(({ start, end }) => {
const adjustedStart = new Date(start);
adjustedStart.setDate(adjustedStart.getDate() - offset);
return start <= now && now <= end
const match = adjustedStart <= now && now <= end;
if (!match || (excludeShortRCP && isShortRCP(start, end))) return false;
return true;
})) {
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.'
Expand Down Expand Up @@ -148,6 +154,7 @@ module.exports = {
getLocalConfigs,
slackNotification,
pulls: { addLabels, addFiles, getChecks, getReviews },
isShortRCP,
isWithinRCP,
RCPDates,
};
3 changes: 2 additions & 1 deletion .github/workflows/merge-to-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
const PR_TITLE = '[Release] Stage to Main';
const STAGE = 'stage';
const PROD = 'main';
const MIN_SOT_APPROVALS = process.env.MIN_SOT_APPROVALS ? Number(process.env.MIN_SOT_APPROVALS) : 4;

let github, owner, repo;

Expand Down Expand Up @@ -40,7 +41,7 @@ const main = async (params) => {
const stageToMainPR = await getStageToMainPR();
const signOffs = stageToMainPR?.labels.filter((l) => l.includes('SOT'));
console.log(`${signOffs.length} SOT labels on PR ${stageToMainPR.number}`);
if (signOffs.length >= 4) {
if (signOffs.length >= MIN_SOT_APPROVALS) {
console.log('Stage to Main PR has all required labels. Merging...');
await github.rest.pulls.merge({
owner,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/merge-to-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

env:
MILO_RELEASE_SLACK_WH: ${{ secrets.MILO_RELEASE_SLACK_WH }}
MIN_SOT_APPROVALS: ${{ secrets.MIN_SOT_APPROVALS }}

jobs:
merge-to-main:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-to-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const main = async (params) => {
github = params.github;
owner = params.context.repo.owner;
repo = params.context.repo.repo;
if (isWithinRCP(process.env.STAGE_RCP_OFFSET_DAYS || 2)) return console.log('Stopped, within RCP period.');
if (isWithinRCP({ offset: process.env.STAGE_RCP_OFFSET_DAYS || 2, excludeShortRCP: true })) return console.log('Stopped, within RCP period.');

try {
const stageToMainPR = await getStageToMainPR();
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/rcp-notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ const {
slackNotification,
getLocalConfigs,
RCPDates,
isShortRCP,
} = require('./helpers.js');

const isWithin24Hours = (targetDate) =>
Math.abs(new Date() - targetDate) <= 24 * 60 * 60 * 1000;
const isWithin24Hours = (targetDate) => {
const now = new Date();
return now < targetDate && new Date(now.getTime() + 24 * 60 * 60 * 1000) > targetDate;
};

const calculateDateOffset = (date, offset) => {
const newDate = new Date(date);
Expand All @@ -19,17 +22,18 @@ const main = async () => {
for (const rcp of RCPDates) {
const start = new Date(rcp.start);
const end = new Date(rcp.end);
const isShort = isShortRCP(start, end);
const tenDaysBefore = calculateDateOffset(start, 10);
const fourDaysBefore = calculateDateOffset(start, 4);
const stageOffset = Number(process.env.STAGE_RCP_OFFSET_DAYS) || 2;
const slackText = (days) =>
`Reminder RCP starts in ${days} days: from ${start.toUTCString()} to ${end.toUTCString()}. Merges to stage will be disabled beginning ${calculateDateOffset(start, stageOffset).toUTCString()}.`;
if (isWithin24Hours(tenDaysBefore)) {
if (isWithin24Hours(tenDaysBefore) && !isShort) {
console.log('Is within 24 hours of 10 days before RCP');
await slackNotification(slackText(10), process.env.MILO_DEV_HOOK);
}

if (isWithin24Hours(fourDaysBefore)) {
if (isWithin24Hours(fourDaysBefore) && !isShort) {
console.log('Is within 24 hours of 4 days before RCP');
await slackNotification(slackText(4), process.env.MILO_DEV_HOOK);
}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/run-nala-circleci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Nala Tests on CircleCI

on:
push:
branches:
- stage
workflow_dispatch:

jobs:
trigger-circleci:
Expand All @@ -15,4 +13,4 @@ jobs:
curl -X POST 'https://circle.ci.adobe.com/api/v2/project/gh/wcms/nala/pipeline' \
-H 'Circle-Token: ${{ secrets.CCI_TOKEN }}' \
-H 'content-type: application/json' \
-d "{\"branch\":\"main\"}"
-d "{\"branch\":\"main\"}"
2 changes: 1 addition & 1 deletion libs/blocks/ost/ost.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const IMS_COMMERCE_CLIENT_ID = 'aos_milo_commerce';
const IMS_SCOPE = 'AdobeID,openid';
const IMS_ENV = 'prod';
const IMS_PROD_URL = 'https://auth.services.adobe.com/imslib/imslib.min.js';
const OST_VERSION = '1.18.4';
const OST_VERSION = '1.19.1';
const OST_BASE = `https://www.stage.adobe.com/special/tacocat/ost/lib/${OST_VERSION}`;
const OST_SCRIPT_URL = `${OST_BASE}/index.js`;
const OST_STYLE_URL = `${OST_BASE}/index.css`;
Expand Down
1 change: 1 addition & 0 deletions libs/blocks/table/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@
width: 15px;
height: 15px;
cursor: pointer;
margin-inline: unset;
}

.table .section-head-title:hover .icon.expand {
Expand Down
7 changes: 1 addition & 6 deletions libs/blocks/text/text.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
position: relative;
}

.text-block .icon-list-item .icon.margin-right:not(.margin-left) { /* target first node only */
.text-block .icon-list-item .icon.node-index-first {
position: absolute;
inset: 0 100% auto auto;
}
Expand All @@ -122,7 +122,6 @@

.text-block .icon-area {
display: flex;
column-gap: var(--spacing-xs);
}

.text-block p.icon-area { /* NOT <a/> tags with icons in them */
Expand Down Expand Up @@ -218,10 +217,6 @@
max-width: unset;
}

.text-block .icon-area.con-button {
column-gap: unset;
}

.text-block .icon-area picture {
line-height: 0em;
height: inherit; /* Safari + FF bug fix */
Expand Down
127 changes: 118 additions & 9 deletions libs/blocks/timeline/timeline.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
width: 100%;
margin: 0 auto;
}

.dialog-modal .timeline {
padding: 0 var(--spacing-xl) var(--spacing-xl) var(--spacing-xl);
}
Expand All @@ -12,6 +13,22 @@
display: grid;
}

.timeline.segment-timeline-3-9 .row,
.timeline.segment-timeline-4-8 .row,
.timeline.segment-timeline-5-7 .row {
grid-template-columns: 1fr 58.3%;
}

.timeline.segment-timeline-6-6 .row {
grid-template-columns: 50% 50%;
}

.timeline.segment-timeline-7-5 .row,
.timeline.segment-timeline-8-4 .row,
.timeline.segment-timeline-9-3 .row {
grid-template-columns: 1fr 41.7%;
}

.timeline h1,
.timeline h2,
.timeline h3,
Expand Down Expand Up @@ -40,7 +57,6 @@

.timeline .row:nth-of-type(1)>.left>div>* {
max-width: 100px;
padding-right: var(--spacing-m);
}

.dark .timeline .row:nth-child(3)>div *,
Expand All @@ -59,7 +75,68 @@
}

.timeline .row:nth-of-type(1)>.right {
grid-template-columns: minmax(110px, 1fr) 1fr;
grid-template-columns: 1.5fr 1fr;
grid-gap: 8px;
}

[dir="rtl"] .timeline .row:nth-of-type(1)>.right {
grid-template-columns: 1fr 1fr;
}

.timeline.segment-timeline-3-9 .left-center,
.timeline.segment-timeline-4-8 .left-center,
.timeline.segment-timeline-5-7 .left-center,
.timeline.segment-timeline-6-6 .left-center {
display: none;
}
@media screen and (max-width: 599.99px) {
.timeline.segment-timeline-7-5 .row:nth-of-type(1)>.right,
.timeline.segment-timeline-8-4 .row:nth-of-type(1)>.right,
.timeline.segment-timeline-9-3 .row:nth-of-type(1)>.right {
grid-template-columns: 1fr;
}

.timeline.segment-timeline-7-5 .row:nth-of-type(1)>.left,
.timeline.segment-timeline-8-4 .row:nth-of-type(1)>.left,
.timeline.segment-timeline-9-3 .row:nth-of-type(1)>.left {
grid-template-columns: 1fr 1.5fr;
display: grid;
justify-content: space-between;
grid-gap: 8px;
}

.timeline.segment-timeline-7-5 .right-center,
.timeline.segment-timeline-8-4 .right-center,
.timeline.segment-timeline-9-3 .right-center {
display: none;
}

.timeline.segment-timeline-7-5 .left-center,
.timeline.segment-timeline-8-4 .left-center,
.timeline.segment-timeline-9-3 .left-center {
text-align: right;
display: flex;
flex-direction: column;
align-items: flex-end;
}

[dir="rtl"] .timeline.segment-timeline-7-5 .left-center,
[dir="rtl"] .timeline.segment-timeline-8-4 .left-center,
[dir="rtl"] .timeline.segment-timeline-9-3 .left-center {
text-align: left;
}

.timeline .row:nth-of-type(1)>.left .left-center>* {
padding-right: 0;
}
}

@media screen and (min-width: 600px) {
.timeline.segment-timeline-7-5 .left-center,
.timeline.segment-timeline-8-4 .left-center,
.timeline.segment-timeline-9-3 .left-center {
display: none;
}
}

.timeline .row:nth-of-type(2)>.right {
Expand All @@ -68,7 +145,7 @@

.timeline .row:nth-of-type(1)>.right>div:nth-of-type(1) {
max-width: 135px;
padding-right: var(--spacing-xxs);
/* padding-right: var(--spacing-xxs); */
}

.timeline .bar {
Expand Down Expand Up @@ -103,10 +180,18 @@
}

[dir="rtl"] .timeline .row:nth-of-type(1)>.left>div>* {
padding: 0 0 0 var(--spacing-m);
/* padding: 0 0 0 var(--spacing-m); */
padding: 0;
text-align: right;
}

[dir="rtl"] .timeline.timeline.segment-timeline-7-5 .row:nth-of-type(1)>.left>.left-center>*,
[dir="rtl"] .timeline.timeline.segment-timeline-8-4 .row:nth-of-type(1)>.left>.left-center>*,
[dir="rtl"] .timeline.timeline.segment-timeline-9-3 .row:nth-of-type(1)>.left>.left-center>* {
padding: 0;
text-align: left;
}

[dir="rtl"] .timeline .row:nth-of-type(1)>.right>div+div {
padding: 0 0 var(--spacing-xxs) 0;
text-align: left;
Expand All @@ -120,15 +205,40 @@
margin: 0 3px 0 0;
}

[dir="rtl"] .timeline .row:nth-of-type(1)>.right>div:nth-of-type(1) {
padding: 0 0 0 var(--spacing-xxs);
}

@media screen and (min-width: 600px) {
.dialog-modal .timeline {
padding: 0 var(--spacing-xl) var(--spacing-xl) var(--spacing-xl);
}
}
@media screen and (min-width: 1200px) {
.timeline.segment-timeline-3-9 .row {
grid-template-columns: 1fr 75%
}

.timeline.segment-timeline-4-8 .row {
grid-template-columns: 1fr 66.69%;
}

.timeline.segment-timeline-5-7 .row {
grid-template-columns: 1fr 58.3%;
}

.timeline.segment-timeline-6-6 .row {
grid-template-columns: 1fr 50%;
}

.timeline.segment-timeline-7-5 .row {
grid-template-columns: 1fr 41.7%;
}

.timeline.segment-timeline-8-4 .row {
grid-template-columns: 1fr 33.3%;
}

.timeline.segment-timeline-9-3 .row {
grid-template-columns: 1fr 25%;
}
}

@media screen and (min-width:1120px) {
.timeline {
Expand All @@ -140,4 +250,3 @@
padding: 0 var(--spacing-xl) var(--spacing-xl) var(--spacing-xl);
}
}

Loading

0 comments on commit 1c86cc2

Please sign in to comment.