Skip to content

Commit 331318f

Browse files
committed
Merge branch 'main' into fix/63358
2 parents c7cd517 + 54e5acb commit 331318f

70 files changed

Lines changed: 1015 additions & 364 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.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/bin/bash
2+
3+
# Checks for usage of iframe and non-cloudflare URL for videos in documentation.
4+
# Assumes that Jekyll markdown documents compile and render correctly, i.e.
5+
# no malformed HTML tags or liquid tags.
6+
set -eu
7+
8+
source ./scripts/shellUtils.sh
9+
title "Enforce no iframe usage for videos and cloudflare CDN links"
10+
HAS_VIOLATION=false
11+
12+
# Use diff to find all changed markdown files in the docs/ directory compared
13+
# the current HEAD commit on main. This will mirror behavior on the workflow
14+
# when the local copy of origin/main is up-to-date. We exclude the README.md
15+
# files from linting.
16+
CHANGED_FILES="$(git diff origin/main..HEAD --name-only --diff-filter=MAR -- ':docs/*.md' ':(exclude,icase)*README.md')"
17+
18+
# RegEx to match the opening iframe tags.
19+
# Matches iframes like: <iframe src="https://myembeddedvideo.com" allowfullscreen width="10" height="10" allow="autoplay">
20+
# Broken into 2 consecutive non-capturing groups "(?:[...])".
21+
# Non-capturing groups are part of the matching pattern, but not returned in matches.
22+
# First Group: "<iframe[^>]*?"
23+
# - Checks for the iframe opening tag <iframe, and "[^>]*" non-greedily
24+
# consumes characters except for ">" (as few characters as possible
25+
# upto the closing tag).
26+
# Second Group: OR of three attribute tags "(\s*width|\s*height|\s*src)+"
27+
# - This "+" checks for at least one of the attributes in the group, in any order.
28+
# This is what we use to check if it's an embed.
29+
# - Each attribute tag consists of a named capturing group that saves quoted value
30+
# after the "=":
31+
# - [\"\"'](?<width>[^\"\"']+)[\"\"']
32+
# This matches the opening quotation marks followed by the named capturing
33+
# group (?<width>[....]) and the [^\"\"'] matches any character that isn't
34+
# a closing quotation mark. This doesn't allow for empty width attribute.
35+
# Followed by the closing quotation mark.
36+
# Finally, [^>]*? consumes all remaining characters after the attributes and
37+
# closes the iframe tag with ">". We consider there to be an iframe in the file
38+
# if all this is satisfied.
39+
REGEX="(?:<iframe[^>]*?)(?:\s*width=[\"\"'](?<width>[^\"\"']+)[\"\"']|\s*height=[\"\"'](?<height>[^'\"\"]+)[\"\"']|\s*src=[\"\"'](?<src>[^'\"\"]+[\"\"']))+[^>]*?>"
40+
while IFS= read -r FILE; do
41+
while IFS= read -r MATCH; do
42+
error "$FILE:$MATCH Do not use iframes for video embeds."
43+
HAS_VIOLATION=true
44+
done < <(pcregrep -n "$REGEX" "$FILE")
45+
done <<< "$CHANGED_FILES"
46+
47+
# RegEx to match liquid Jekyll tag for included videos, and extracts the src.
48+
# Matches includes like: {% include video.html src="https://incorrectlyembeddedvideo.com" %}
49+
#
50+
# The regex begins by checking for the opening "{% include video.html" with any
51+
# white spacing that wouldn't break the liquid tag. Followed by some white space.
52+
#
53+
# Next we have one non-capturing group "(?:[...])+" for attributes "thumbnail=..." and "src=....".
54+
# We expect at least one of these elements to appear.
55+
# Each attribute is formatted as: \s*ATTR=[\"\"'](?<ATTR>[^\"\"']+)[\"\"']
56+
# - This is zero or more whitespace followed by the opening "ATTR=", opening
57+
# quotes with non-empty string inside, and closing quotes. We capture the
58+
# value of the attribute using a named capturing group "(?<ATTR>[...])".
59+
# The attribute is closed then with some closing quotation marks "[\"\"']".
60+
# We close the regex with optional white space and ending %}. We extract
61+
REGEX="{%\s*include\s+video\.html\s+(?:\s*thumbnail=[\"\"'](?<thumbnail>[^'\"\"]+)[\"\"']|\s*src=[\"\"'](?<src>[^'\"\"]+[\"\"']))+\s*%}"
62+
63+
# RegEx to match a cloudflare CDN URL. Expects leading customer number and trailing content ID.
64+
# We match the "https://" followed by some subdomain "(?:\S+)" of alphanumeric-characters
65+
# usually customer information, then ".cloudflarestream.com/" and the optional trailing
66+
# remaining characters "(?:\S*)" usually content ID.
67+
CDN_REGEX="https:\/\/(?:\S+)\.cloudflarestream\.com\/(?:\S*)"
68+
while IFS= read -r FILE; do
69+
while IFS= read -r MATCH; do
70+
if ! echo "$MATCH" | pcregrep -q "$CDN_REGEX"; then
71+
error "$FILE:$MATCH Video URL must be from Cloudflare CDN."
72+
HAS_VIOLATION=true
73+
fi
74+
done < <(pcregrep -n "$REGEX" "$FILE")
75+
done <<< "$CHANGED_FILES"
76+
77+
if [[ $HAS_VIOLATION == true ]]; then
78+
error "Documentation has video violations"
79+
exit 1
80+
fi
81+
82+
success "No violations."

.github/workflows/deployExpensifyHelp.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939

40+
- name: Install pcregrep
41+
run: sudo apt-get install -y pcregrep
42+
4043
- name: Setup NodeJS
4144
uses: ./.github/actions/composite/setupNode
4245

@@ -48,6 +51,9 @@ jobs:
4851

4952
- name: Enforce that a redirect link has been created
5053
run: ./.github/scripts/enforceRedirect.sh
54+
55+
- name: Enforce iframe and Cloudflare CDN usage
56+
run: ./.github/scripts/enforceVideoFormats.sh
5157

5258
- name: Build with Jekyll
5359
uses: actions/jekyll-build-pages@0143c158f4fa0c5dcd99499a5d00859d79f70b0e

Mobile-Expensify

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ android {
114114
minSdkVersion rootProject.ext.minSdkVersion
115115
targetSdkVersion rootProject.ext.targetSdkVersion
116116
multiDexEnabled rootProject.ext.multiDexEnabled
117-
versionCode 1009019100
118-
versionName "9.1.91-0"
117+
versionCode 1009019201
118+
versionName "9.1.92-1"
119119
// Supported language variants must be declared here to avoid from being removed during the compilation.
120120
// This also helps us to not include unnecessary language variants in the APK.
121121
resConfigs "en", "es"

docs/articles/expensify-classic/getting-started/Join-Your-Company's-Workspace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Upload expenses and check reports from your phone by downloading the Expensify m
1616
- [iOS](https://apps.apple.com/us/app/expensify-expense-tracker/id471713959)
1717
- [Android](https://play.google.com/store/apps/details?id=org.me.mobiexpensifyg&hl=en_US&gl=US)
1818

19-
For a full walkthrough on creating and submitting expenses via the mobile app, click [here](https://expensify.navattic.com/fl150n1n)!
19+
For a full walkthrough on creating and submitting expenses via the mobile app, click [here](https://app.storylane.io/share/wckqdetaacgy?embed=inline)!
2020

2121
---
2222

ios/NewExpensify/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<key>CFBundlePackageType</key>
2424
<string>APPL</string>
2525
<key>CFBundleShortVersionString</key>
26-
<string>9.1.91</string>
26+
<string>9.1.92</string>
2727
<key>CFBundleSignature</key>
2828
<string>????</string>
2929
<key>CFBundleURLTypes</key>
@@ -44,7 +44,7 @@
4444
</dict>
4545
</array>
4646
<key>CFBundleVersion</key>
47-
<string>9.1.91.0</string>
47+
<string>9.1.92.1</string>
4848
<key>FullStory</key>
4949
<dict>
5050
<key>OrgId</key>

ios/NotificationServiceExtension/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<key>CFBundleName</key>
1212
<string>$(PRODUCT_NAME)</string>
1313
<key>CFBundleShortVersionString</key>
14-
<string>9.1.91</string>
14+
<string>9.1.92</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.1.91.0</string>
16+
<string>9.1.92.1</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionPointIdentifier</key>

ios/ShareViewController/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<key>CFBundleName</key>
1212
<string>$(PRODUCT_NAME)</string>
1313
<key>CFBundleShortVersionString</key>
14-
<string>9.1.91</string>
14+
<string>9.1.92</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.1.91.0</string>
16+
<string>9.1.92.1</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionAttributes</key>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "9.1.91-0",
3+
"version": "9.1.92-1",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
@@ -46,7 +46,7 @@
4646
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
4747
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4848
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
49-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=294 --cache --cache-location=node_modules/.cache/eslint",
49+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=281 --cache --cache-location=node_modules/.cache/eslint",
5050
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
5151
"lint-watch": "npx eslint-watch --watch --changed",
5252
"shellcheck": "./scripts/shellCheck.sh",

0 commit comments

Comments
 (0)