-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11136 from 18F/stages/rc-2024-08-22
Deploy RC 408 to Production
- Loading branch information
Showing
109 changed files
with
2,364 additions
and
927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ public | |
vendor | ||
coverage | ||
doc | ||
app/javascript/packages/analytics/digital-analytics-program*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module AbTestingConcern | ||
# @param [Symbol] test Name of the test, which should correspond to an A/B test defined in | ||
# # config/initializer/ab_tests.rb. | ||
# @return [Symbol,nil] Bucket to use for the given test, or nil if the test is not active. | ||
def ab_test_bucket(test_name) | ||
test = AbTests.all[test_name] | ||
raise "Unknown A/B test: #{test_name}" unless test | ||
|
||
test.bucket( | ||
request:, | ||
service_provider: current_sp&.issuer, | ||
session:, | ||
user: current_user, | ||
user_session:, | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Idv | ||
module DocAuthVendorConcern | ||
include AbTestingConcern | ||
|
||
# @returns[String] String identifying the vendor to use for doc auth. | ||
def doc_auth_vendor | ||
bucket = ab_test_bucket(:DOC_AUTH_VENDOR) | ||
DocAuthRouter.doc_auth_vendor_for_bucket(bucket) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
digital-analytics-program*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
DAP_SHA ?= 7c14bb3 | ||
|
||
digital-analytics-program.js: digital-analytics-program-$(DAP_SHA).js digital-analytics-program.patch | ||
patch -p1 $^ --output $@ | ||
|
||
digital-analytics-program-$(DAP_SHA).js: | ||
curl https://raw.githubusercontent.com/digital-analytics-program/gov-wide-code/$(DAP_SHA)/Universal-Federated-Analytics.js --silent --output $@ | ||
|
||
clean: | ||
rm digital-analytics-program-$(DAP_SHA).js digital-analytics-program.js | ||
|
||
.PHONY: clean |
8 changes: 8 additions & 0 deletions
8
app/javascript/packages/analytics/digital-analytics-program.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
73a74 | ||
> GA4Object.defer = true; | ||
785d785 | ||
< var piiRegex = []; | ||
900c900 | ||
< piiRegex.forEach(function (pii) { | ||
--- | ||
> window.piiRegex.forEach(function (pii) { |
26 changes: 26 additions & 0 deletions
26
app/javascript/packages/analytics/digital-analytics-program.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Worker } from 'node:worker_threads'; | ||
import { join } from 'node:path'; | ||
import { pathToFileURL } from 'node:url'; | ||
|
||
describe('digital analytics program', () => { | ||
it('parses without syntax error', async () => { | ||
// Future: Replace with Promise.withResolvers once supported | ||
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers | ||
let resolve; | ||
const promise = new Promise((_resolve) => { | ||
resolve = _resolve; | ||
}); | ||
|
||
// Reference: https://github.com/nodejs/node/issues/30682 | ||
const toDataURL = (source: string) => | ||
new URL(`data:text/javascript,${encodeURIComponent(source)}`); | ||
const url = pathToFileURL(join(__dirname, './digital-analytics-program.js')); | ||
const code = `await import(${JSON.stringify(url)});`; | ||
new Worker(toDataURL(code)).on('error', (error) => { | ||
expect(error).not.to.be.instanceOf(SyntaxError); | ||
resolve(); | ||
}); | ||
|
||
await promise; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '@18f/identity-analytics/digital-analytics-program'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.