Skip to content

Commit a68c983

Browse files
committed
Merge branch 'main' of github.com:Expensify/App into parasharrajat/workspace-chat-invite-whisper
2 parents 2178852 + 9494e08 commit a68c983

1,303 files changed

Lines changed: 41416 additions & 24182 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.

.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ const restrictedImportPaths = [
100100
name: 'react-native-animatable',
101101
message: "Please use 'react-native-reanimated' instead.",
102102
},
103+
{
104+
name: 'react-native-onyx',
105+
importNames: ['useOnyx'],
106+
message: "Please use '@hooks/useOnyx' instead.",
107+
},
103108
];
104109

105110
const restrictedImportPatterns = [
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 & 39 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
*
@@ -15529,6 +15621,7 @@ const core = __importStar(__nccwpck_require__(2186));
1552915621
const utils_1 = __nccwpck_require__(3030);
1553015622
const plugin_paginate_rest_1 = __nccwpck_require__(4193);
1553115623
const plugin_throttling_1 = __nccwpck_require__(9968);
15624+
const request_error_1 = __nccwpck_require__(537);
1553215625
const EmptyObject_1 = __nccwpck_require__(8227);
1553315626
const arrayDifference_1 = __importDefault(__nccwpck_require__(7034));
1553415627
const CONST_1 = __importDefault(__nccwpck_require__(9873));
@@ -15565,7 +15658,11 @@ class GithubUtils {
1556515658
* @private
1556615659
*/
1556715660
static initOctokit() {
15568-
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+
}
1556915666
this.initOctokitWithToken(token);
1557015667
}
1557115668
/**
@@ -15948,6 +16045,64 @@ class GithubUtils {
1594816045
})
1594916046
.then((response) => response.url);
1595016047
}
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+
}
1595116106
}
1595216107
exports["default"] = GithubUtils;
1595316108

0 commit comments

Comments
 (0)