Skip to content

Commit ec28be4

Browse files
committed
Merge branch 'main' into fix/62326-magic-code-not-sent
2 parents 98b56c5 + fd5c717 commit ec28be4

1,158 files changed

Lines changed: 117623 additions & 37804 deletions

File tree

Some content is hidden

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

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ FB_APP_ID=YOUR_APP_ID
3838
FB_PROJECT_ID=YOUR_PROJECT_ID
3939

4040
GITHUB_TOKEN=YOUR_TOKEN
41+
OPENAI_API_KEY=YOUR_TOKEN

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ const restrictedImportPaths = [
8787
importNames: ['memoize'],
8888
message: "Please use '@src/libs/memoize' instead.",
8989
},
90+
{
91+
name: 'lodash/isEqual',
92+
message: "Please use 'deepEqual' from 'fast-equals' instead.",
93+
},
94+
{
95+
name: 'lodash',
96+
importNames: ['isEqual'],
97+
message: "Please use 'deepEqual' from 'fast-equals' instead.",
98+
},
9099
{
91100
name: 'react-native-animatable',
92101
message: "Please use 'react-native-reanimated' instead.",
@@ -292,6 +301,7 @@ module.exports = {
292301
'@libs': './src/libs',
293302
'@navigation': './src/libs/Navigation',
294303
'@pages': './src/pages',
304+
'@prompts': './prompts',
295305
'@styles': './src/styles',
296306
// This path is provide alias for files like `ONYXKEYS` and `CONST`.
297307
'@src': './src',
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Patch Tracking
3+
about: Template for tracking patches applied to third-party libraries
4+
---
5+
6+
If you haven't already, check out our [contributing guidelines](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md) and [patch guidelines](https://github.com/Expensify/App/blob/main/contributingGuides/PATCHES.md) for information on how to manage patches.
7+
___
8+
9+
## Patch Information
10+
11+
**Library Name:** <!-- e.g., react-native-pdf -->
12+
**Library Version:** <!-- e.g., 6.7.3 -->
13+
**Patch Number:** <!-- e.g., 001 -->
14+
**Patch Description:** <!-- e.g., update-podspec-to-support-new-arch -->
15+
**Full Patch Filename:** <!-- e.g., react-native-pdf+6.7.3+001+update-podspec-to-support-new-arch.patch -->
16+
17+
## Patch Details
18+
19+
### Reason for Patch
20+
<!-- Explain why this patch is necessary. What issue does it solve? -->
21+
22+
### Changes Made
23+
<!-- Briefly describe the changes made in the patch -->
24+
25+
### Upstream Status
26+
**Upstream PR/Issue:** <!-- Link to the PR or issue in the upstream repository, if one exists -->
27+
28+
## Related Information
29+
30+
**PR Introducing Patch:** <!-- Link to the PR that introduced this patch -->
31+
32+
## Additional Notes
33+
<!-- Any other relevant information about this patch -->
34+
35+
## Checklist
36+
- [ ] Patch file is correctly named and placed in the appropriate directory
37+
- [ ] Patch is documented in the corresponding `details.md` file
38+
- [ ] This issue is linked in the `details.md` file
39+
- [ ] Upstream PR/issue has been created (if applicable)

.github/actions/javascript/authorChecklist/index.js

Lines changed: 194 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6748,6 +6748,79 @@ exports.throttling = throttling;
67486748
//# sourceMappingURL=index.js.map
67496749

67506750

6751+
/***/ }),
6752+
6753+
/***/ 537:
6754+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6755+
6756+
"use strict";
6757+
6758+
6759+
Object.defineProperty(exports, "__esModule", ({ value: true }));
6760+
6761+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6762+
6763+
var deprecation = __nccwpck_require__(8932);
6764+
var once = _interopDefault(__nccwpck_require__(1223));
6765+
6766+
const logOnceCode = once(deprecation => console.warn(deprecation));
6767+
const logOnceHeaders = once(deprecation => console.warn(deprecation));
6768+
/**
6769+
* Error with extra properties to help with debugging
6770+
*/
6771+
class RequestError extends Error {
6772+
constructor(message, statusCode, options) {
6773+
super(message);
6774+
// Maintains proper stack trace (only available on V8)
6775+
/* istanbul ignore next */
6776+
if (Error.captureStackTrace) {
6777+
Error.captureStackTrace(this, this.constructor);
6778+
}
6779+
this.name = "HttpError";
6780+
this.status = statusCode;
6781+
let headers;
6782+
if ("headers" in options && typeof options.headers !== "undefined") {
6783+
headers = options.headers;
6784+
}
6785+
if ("response" in options) {
6786+
this.response = options.response;
6787+
headers = options.response.headers;
6788+
}
6789+
// redact request credentials without mutating original request options
6790+
const requestCopy = Object.assign({}, options.request);
6791+
if (options.request.headers.authorization) {
6792+
requestCopy.headers = Object.assign({}, options.request.headers, {
6793+
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
6794+
});
6795+
}
6796+
requestCopy.url = requestCopy.url
6797+
// client_id & client_secret can be passed as URL query parameters to increase rate limit
6798+
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
6799+
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]")
6800+
// OAuth tokens can be passed as URL query parameters, although it is not recommended
6801+
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
6802+
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
6803+
this.request = requestCopy;
6804+
// deprecations
6805+
Object.defineProperty(this, "code", {
6806+
get() {
6807+
logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
6808+
return statusCode;
6809+
}
6810+
});
6811+
Object.defineProperty(this, "headers", {
6812+
get() {
6813+
logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."));
6814+
return headers || {};
6815+
}
6816+
});
6817+
}
6818+
}
6819+
6820+
exports.RequestError = RequestError;
6821+
//# sourceMappingURL=index.js.map
6822+
6823+
67516824
/***/ }),
67526825

67536826
/***/ 3682:
@@ -8591,6 +8664,7 @@ function useColors() {
85918664

85928665
// Is webkit? http://stackoverflow.com/a/16459606/376773
85938666
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
8667+
// eslint-disable-next-line no-return-assign
85948668
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
85958669
// Is firebug? http://stackoverflow.com/a/398120/376773
85968670
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
@@ -8906,24 +8980,62 @@ function setup(env) {
89068980
createDebug.names = [];
89078981
createDebug.skips = [];
89088982

8909-
let i;
8910-
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
8911-
const len = split.length;
8983+
const split = (typeof namespaces === 'string' ? namespaces : '')
8984+
.trim()
8985+
.replace(' ', ',')
8986+
.split(',')
8987+
.filter(Boolean);
89128988

8913-
for (i = 0; i < len; i++) {
8914-
if (!split[i]) {
8915-
// ignore empty strings
8916-
continue;
8989+
for (const ns of split) {
8990+
if (ns[0] === '-') {
8991+
createDebug.skips.push(ns.slice(1));
8992+
} else {
8993+
createDebug.names.push(ns);
89178994
}
8995+
}
8996+
}
89188997

8919-
namespaces = split[i].replace(/\*/g, '.*?');
8920-
8921-
if (namespaces[0] === '-') {
8922-
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
8998+
/**
8999+
* Checks if the given string matches a namespace template, honoring
9000+
* asterisks as wildcards.
9001+
*
9002+
* @param {String} search
9003+
* @param {String} template
9004+
* @return {Boolean}
9005+
*/
9006+
function matchesTemplate(search, template) {
9007+
let searchIndex = 0;
9008+
let templateIndex = 0;
9009+
let starIndex = -1;
9010+
let matchIndex = 0;
9011+
9012+
while (searchIndex < search.length) {
9013+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
9014+
// Match character or proceed with wildcard
9015+
if (template[templateIndex] === '*') {
9016+
starIndex = templateIndex;
9017+
matchIndex = searchIndex;
9018+
templateIndex++; // Skip the '*'
9019+
} else {
9020+
searchIndex++;
9021+
templateIndex++;
9022+
}
9023+
} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
9024+
// Backtrack to the last '*' and try to match more characters
9025+
templateIndex = starIndex + 1;
9026+
matchIndex++;
9027+
searchIndex = matchIndex;
89239028
} else {
8924-
createDebug.names.push(new RegExp('^' + namespaces + '$'));
9029+
return false; // No match
89259030
}
89269031
}
9032+
9033+
// Handle trailing '*' in template
9034+
while (templateIndex < template.length && template[templateIndex] === '*') {
9035+
templateIndex++;
9036+
}
9037+
9038+
return templateIndex === template.length;
89279039
}
89289040

89299041
/**
@@ -8934,8 +9046,8 @@ function setup(env) {
89349046
*/
89359047
function disable() {
89369048
const namespaces = [
8937-
...createDebug.names.map(toNamespace),
8938-
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
9049+
...createDebug.names,
9050+
...createDebug.skips.map(namespace => '-' + namespace)
89399051
].join(',');
89409052
createDebug.enable('');
89419053
return namespaces;
@@ -8949,41 +9061,21 @@ function setup(env) {
89499061
* @api public
89509062
*/
89519063
function enabled(name) {
8952-
if (name[name.length - 1] === '*') {
8953-
return true;
8954-
}
8955-
8956-
let i;
8957-
let len;
8958-
8959-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
8960-
if (createDebug.skips[i].test(name)) {
9064+
for (const skip of createDebug.skips) {
9065+
if (matchesTemplate(name, skip)) {
89619066
return false;
89629067
}
89639068
}
89649069

8965-
for (i = 0, len = createDebug.names.length; i < len; i++) {
8966-
if (createDebug.names[i].test(name)) {
9070+
for (const ns of createDebug.names) {
9071+
if (matchesTemplate(name, ns)) {
89679072
return true;
89689073
}
89699074
}
89709075

89719076
return false;
89729077
}
89739078

8974-
/**
8975-
* Convert regexp to namespace
8976-
*
8977-
* @param {RegExp} regxep
8978-
* @return {String} namespace
8979-
* @api private
8980-
*/
8981-
function toNamespace(regexp) {
8982-
return regexp.toString()
8983-
.substring(2, regexp.toString().length - 2)
8984-
.replace(/\.\*\?$/, '*');
8985-
}
8986-
89879079
/**
89889080
* Coerce `val`.
89899081
*
@@ -15475,12 +15567,7 @@ const CONST = {
1547515567
EVENTS: {
1547615568
ISSUE_COMMENT: 'issue_comment',
1547715569
},
15478-
OPENAI_ROLES: {
15479-
USER: 'user',
15480-
ASSISTANT: 'assistant',
15481-
},
1548215570
PROPOSAL_KEYWORD: 'Proposal',
15483-
OPENAI_THREAD_COMPLETED: 'completed',
1548415571
DATE_FORMAT_STRING: 'yyyy-MM-dd',
1548515572
PULL_REQUEST_REGEX: new RegExp(`${GITHUB_BASE_URL_REGEX.source}/.*/.*/pull/([0-9]+).*`),
1548615573
ISSUE_REGEX: new RegExp(`${GITHUB_BASE_URL_REGEX.source}/.*/.*/issues/([0-9]+).*`),
@@ -15491,8 +15578,6 @@ const CONST = {
1549115578
NO_ACTION: 'NO_ACTION',
1549215579
ACTION_EDIT: 'ACTION_EDIT',
1549315580
ACTION_REQUIRED: 'ACTION_REQUIRED',
15494-
OPENAI_POLL_RATE: 1500,
15495-
OPENAI_POLL_TIMEOUT: 90000,
1549615581
};
1549715582
exports["default"] = CONST;
1549815583

@@ -15536,6 +15621,7 @@ const core = __importStar(__nccwpck_require__(2186));
1553615621
const utils_1 = __nccwpck_require__(3030);
1553715622
const plugin_paginate_rest_1 = __nccwpck_require__(4193);
1553815623
const plugin_throttling_1 = __nccwpck_require__(9968);
15624+
const request_error_1 = __nccwpck_require__(537);
1553915625
const EmptyObject_1 = __nccwpck_require__(8227);
1554015626
const arrayDifference_1 = __importDefault(__nccwpck_require__(7034));
1554115627
const CONST_1 = __importDefault(__nccwpck_require__(9873));
@@ -15572,7 +15658,11 @@ class GithubUtils {
1557215658
* @private
1557315659
*/
1557415660
static initOctokit() {
15575-
const token = core.getInput('GITHUB_TOKEN', { required: true });
15661+
const token = process.env.GITHUB_TOKEN ?? core.getInput('GITHUB_TOKEN', { required: true });
15662+
if (!token) {
15663+
console.error('GitHubUtils could not find GITHUB_TOKEN');
15664+
process.exit(1);
15665+
}
1557615666
this.initOctokitWithToken(token);
1557715667
}
1557815668
/**
@@ -15955,6 +16045,64 @@ class GithubUtils {
1595516045
})
1595616046
.then((response) => response.url);
1595716047
}
16048+
/**
16049+
* Get commits between two tags via the GitHub API
16050+
*/
16051+
static async getCommitHistoryBetweenTags(fromTag, toTag) {
16052+
console.log('Getting pull requests merged between the following tags:', fromTag, toTag);
16053+
core.startGroup('Fetching paginated commits:');
16054+
try {
16055+
let allCommits = [];
16056+
let page = 1;
16057+
const perPage = 250;
16058+
let hasMorePages = true;
16059+
while (hasMorePages) {
16060+
core.info(`📄 Fetching page ${page} of commits...`);
16061+
const response = await this.octokit.repos.compareCommits({
16062+
owner: CONST_1.default.GITHUB_OWNER,
16063+
repo: CONST_1.default.APP_REPO,
16064+
base: fromTag,
16065+
head: toTag,
16066+
per_page: perPage,
16067+
page,
16068+
});
16069+
// Check if we got a proper response with commits
16070+
if (response.data?.commits && Array.isArray(response.data.commits)) {
16071+
if (page === 1) {
16072+
core.info(`📊 Total commits: ${response.data.total_commits ?? 'unknown'}`);
16073+
}
16074+
core.info(`✅ compareCommits API returned ${response.data.commits.length} commits for page ${page}`);
16075+
allCommits = allCommits.concat(response.data.commits);
16076+
// Check if we got fewer commits than requested or if we've reached the total
16077+
const totalCommits = response.data.total_commits;
16078+
if (response.data.commits.length < perPage || (totalCommits && allCommits.length >= totalCommits)) {
16079+
hasMorePages = false;
16080+
}
16081+
else {
16082+
page++;
16083+
}
16084+
}
16085+
else {
16086+
core.warning('⚠️ GitHub API returned unexpected response format');
16087+
hasMorePages = false;
16088+
}
16089+
}
16090+
core.info(`🎉 Successfully fetched ${allCommits.length} total commits`);
16091+
core.endGroup();
16092+
return allCommits.map((commit) => ({
16093+
commit: commit.sha,
16094+
subject: commit.commit.message,
16095+
authorName: commit.commit.author?.name ?? 'Unknown',
16096+
}));
16097+
}
16098+
catch (error) {
16099+
if (error instanceof request_error_1.RequestError && error.status === 404) {
16100+
console.error(`❓❓ Failed to get commits with the GitHub API. The base tag ('${fromTag}') or head tag ('${toTag}') likely doesn't exist on the remote repository. If this is the case, create or push them.`);
16101+
}
16102+
core.endGroup();
16103+
throw error;
16104+
}
16105+
}
1595816106
}
1595916107
exports["default"] = GithubUtils;
1596016108

0 commit comments

Comments
 (0)