Skip to content

Commit 4265f44

Browse files
authored
Merge pull request #1344 from w3c/development
Create March 17, 2025 Release [2] Includes the following changes: * #1336, which addresses #1334 * #1340 * #1339
2 parents b564146 + a6f5c9f commit 4265f44

File tree

8 files changed

+63
-9
lines changed

8 files changed

+63
-9
lines changed

client/components/CandidateReview/CandidateModals/NotApprovedModal/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const NotApprovedModal = ({ handleAction = () => {}, githubUrl = '#' }) => {
1515
<>
1616
<p className="review-confirmation-content">Thank you for reviewing</p>
1717
<p className="review-confirmation-share">
18-
if you haven’t opened any issues yet, please{' '}
18+
If you haven’t opened any issues yet, please{' '}
1919
<a href={githubUrl} target="_blank" rel="noreferrer">
2020
open an issue describing why this is not approved.
2121
</a>

client/components/CandidateReview/CandidateTestPlanRun/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ const CandidateTestPlanRun = () => {
360360
isCandidateReviewChangesRequested: false,
361361
testTitle: undefined,
362362
testRowNumber: undefined,
363+
testSequenceNumber: undefined,
363364
testRenderedUrl: undefined
364365
});
365366

client/tests/e2e/snapshots/saved/_account_settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ <h2>Admin Actions</h2>
9999
<button type="button" class="btn btn-primary">
100100
Import Latest Test Plan Versions
101101
</button>
102-
<p>Date of latest test plan version: March 6, 2025 19:25 UTC</p>
102+
<p>Date of latest test plan version: March 14, 2025 18:33 UTC</p>
103103
</section>
104104
</div>
105105
</main>

client/tests/e2e/snapshots/saved/_data-management.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,7 @@ <h2>Test Plans Status Summary</h2>
22102210
<td>
22112211
<div class="css-bpz90">
22122212
<span class="rd full-width css-be9e2a">R&amp;D</span>
2213-
<p class="review-text">Complete <b>Mar 6, 2025</b></p>
2213+
<p class="review-text">Complete <b>Mar 14, 2025</b></p>
22142214
</div>
22152215
</td>
22162216
<td>
@@ -2233,7 +2233,7 @@ <h2>Test Plans Status Summary</h2>
22332233
<path
22342234
fill="currentColor"
22352235
d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"></path></svg
2236-
><b>V25.03.06</b></span
2236+
><b>V25.03.14</b></span
22372237
></a
22382238
></span
22392239
><button

client/utils/createIssueLink.js

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,51 @@ const GITHUB_ISSUES_URL =
33
? 'https://github.com/w3c/aria-at'
44
: 'https://github.com/bocoup/aria-at';
55

6+
// Maximum URL length for GitHub issues
7+
// Tested on multiple browsers and devices
8+
const MAX_GITHUB_URL_LENGTH = 8000;
9+
610
// TODO: Use At.key
711
const atLabelMap = {
812
'VoiceOver for macOS': 'vo',
913
JAWS: 'jaws',
1014
NVDA: 'nvda'
1115
};
1216

17+
/**
18+
* Returns a truncation message for URLs that are too long.
19+
*
20+
* @param {number|null} testSequenceNumber - Optional test sequence number to include in truncation message
21+
* @returns {string} The truncation message
22+
*/
23+
const getTruncationMessage = (testSequenceNumber = null) => {
24+
return `...\n\n[**Content truncated due to URL length limits.** Please visit [${
25+
window.location
26+
}](${window.location}) to review ${
27+
!testSequenceNumber ? 'further' : `Test ${testSequenceNumber}`
28+
}.]`;
29+
};
30+
31+
/**
32+
* Truncates a body string to ensure the resulting URL stays under the maximum length.
33+
*
34+
* @param {string} body - The original body content
35+
* @param {string} baseUrl - The URL without the body (including title and labels)
36+
* @param {number|null} testSequenceNumber - Optional test sequence number to include in truncation message
37+
* @returns {string} The truncated body that will keep the URL under the maximum length
38+
*/
39+
const truncateUrlBody = (body, baseUrl, testSequenceNumber = null) => {
40+
const maxUrlLength = MAX_GITHUB_URL_LENGTH;
41+
const truncationMessage = getTruncationMessage(testSequenceNumber);
42+
43+
// Multiply by 0.65 to account for encoding
44+
const maxBodyLength = Math.floor(
45+
(maxUrlLength - baseUrl.length - truncationMessage.length) * 0.65
46+
);
47+
48+
return body.substring(0, maxBodyLength) + truncationMessage;
49+
};
50+
1351
/**
1452
* Creates a link to open a new issue on the GitHub repository.
1553
*
@@ -183,10 +221,19 @@ const createIssueLink = ({
183221
body += `\n${conflictMarkdown}`;
184222
}
185223

186-
return (
187-
`${GITHUB_ISSUES_URL}/issues/new?title=${encodeURI(title)}&` +
188-
`labels=${labels}&body=${encodeURIComponent(body)}`
189-
);
224+
// Create the base URL without the body
225+
const baseUrl = `${GITHUB_ISSUES_URL}/issues/new?title=${encodeURI(
226+
title
227+
)}&labels=${labels}&body=`;
228+
229+
let url = baseUrl + encodeURIComponent(body);
230+
231+
if (url.length > MAX_GITHUB_URL_LENGTH) {
232+
body = truncateUrlBody(body, baseUrl, testSequenceNumber);
233+
url = baseUrl + encodeURIComponent(body);
234+
}
235+
236+
return url;
190237
};
191238

192239
/**

server/resolvers/helpers/processCopiedReports.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ const processCopiedReports = async ({
329329
);
330330

331331
for (const oldTestPlanRun of oldTestPlanReport.testPlanRuns) {
332+
// Don't create a new test plan run if previous run was for a bot to avoid unexpected assignment results
333+
// Bot assignments orchestrated and controlled by separate system
334+
const isBotIdRegex = /^9\d{3}$/; // Currently, user ids for bots are in the format '9XXX'
335+
if (isBotIdRegex.test(oldTestPlanRun.testerUserId)) continue;
336+
332337
const oldTestPlanRunVendorReviewStatus =
333338
oldTestPlanReport.vendorReviewStatus;
334339

server/services/GithubService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const getAllIssues = async () => {
4949
// Our issue API should only return issues that were originally
5050
// created by the app, indicated by the presence of metadata
5151
// hidden in a comment
52-
.filter(data => data.body.includes('ARIA_AT_APP_ISSUE_DATA'));
52+
.filter(data => data.body?.includes('ARIA_AT_APP_ISSUE_DATA'));
5353

5454
currentResults = [...currentResults, ...issues];
5555

server/util/aria.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const testWithModifiedAttributes = (test, { forUpdateCompare }) => {
2828
// The updated settings, instructions or references should be shown when
2929
// the copy process is done
3030
propertiesToOmit.push('renderableContent.target.at.settings');
31+
propertiesToOmit.push('renderableContent.target.referencePage');
3132
propertiesToOmit.push('renderableContent.instructions');
3233
propertiesToOmit.push('renderableContent.info.references');
3334
// for v1 format since structure is:

0 commit comments

Comments
 (0)