Skip to content

Commit

Permalink
Merge branch 'staging' into fix/delete-duplicated-subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
clari182 committed Dec 13, 2023
2 parents c85934d + ecd0c14 commit 1fcf7c1
Show file tree
Hide file tree
Showing 28 changed files with 2,743 additions and 616 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,12 @@ GATSBY_EXCLUDE_DATASTORE_FROM_BUNDLE=1 # specific to Netlify, for large sites
GATSBY_CPU_COUNT=2 # limits the number of Gatsby threads, helping with deployment stability
NODE_VERSION=18 # this is required by Gatsby v5
NODE_OPTIONS=--max-old-space-size=4096 # increase default heap size to prevent crashes during build
# The following "CLOUDFLARE_R2" variables are required to create the /research/snapshots/ page
CLOUDFLARE_R2_ACCOUNT_ID=[The Cloudflare R2 account ID (e.g.: 8f4144a9d995a9921d0200db59f6a00e)]
CLOUDFLARE_R2_ACCESS_KEY_ID=[The Cloudflare R2 access key ID (e.g.: 7aa73208bc89cee3195879e578b291ee)]
CLOUDFLARE_R2_SECRET_ACCESS_KEY=[The Cloudflare R2 secret access key]
CLOUDFLARE_R2_BUCKET_NAME=[The Cloudflare R2 bucket name (e.g.: 'aiid-public')]
GATSBY_CLOUDFLARE_R2_PUBLIC_BUCKET_URL=[The Cloudflare R2 public bucket URL (e.g.: https://pub-daddb16dc28841779b83690f75eb5c58.r2.dev)]
```
### Github Actions
Two workflows take care of deploying the Realm app to both `production` and `staging` environments, defined in `realm-production.yml` and `realm-staging.yml`. Each workflow looks for environment variables defined in a GitHub Environment named `production` and `staging`.
Expand Down
7 changes: 7 additions & 0 deletions site/gatsby-site/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ const config = {
rollbar: {
token: process.env.GATSBY_ROLLBAR_TOKEN,
},
cloudflareR2: {
accountId: process.env.CLOUDFLARE_R2_ACCOUNT_ID,
accessKeyId: process.env.CLOUDFLARE_R2_ACCESS_KEY_ID,
secretAccessKey: process.env.CLOUDFLARE_R2_SECRET_ACCESS_KEY,
bucketName: process.env.CLOUDFLARE_R2_BUCKET_NAME,
publicBucketUrl: process.env.GATSBY_CLOUDFLARE_R2_PUBLIC_BUCKET_URL,
},
};

module.exports = config;
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ describe('Checklists App Index', () => {
cy.get(newChecklistButtonQuery).should('exist');
});

maybeIt('Should show delete buttons only for owned checklists', () => {
/* We're now showing only the user's owned checklists,
* so we can't test that the delete button doesn't show up on unowned ones.
* Eventually, we'll probably have public checklists show up here too,
* so this can be skipped with a TODO to activate it
* once there are unowned checklists displayed.
*/
it.skip('Should show delete buttons only for owned checklists', () => {
cy.login(Cypress.env('e2eUsername'), Cypress.env('e2ePassword'));

cy.query(usersQuery).then(({ data: { users } }) => {
Expand Down
8 changes: 8 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/apps/submitted.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ describe('Submitted reports', () => {
entities: [
{ __typename: 'Entity', entity_id: 'Adults', name: 'adults' },
{ __typename: 'Entity', entity_id: 'Google', name: 'google' },
{ __typename: 'Entity', entity_id: 'Tesla', name: 'tesla' },
],
},
}
Expand All @@ -813,6 +814,13 @@ describe('Submitted reports', () => {
'value',
'YouTube to crack down on inappropriate content masked as kids’ cartoons'
);

cy.get('input[name="harmed_parties"]').type('Tes');

cy.get('#harmed_parties-tags .dropdown-item')
.contains(/^Tesla$/)
.click();

cy.get('input[label="Image Address"]').should(
'have.attr',
'value',
Expand Down
18 changes: 18 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/cite.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,4 +688,22 @@ describe('Cite pages', () => {

cy.get('[data-cy="incident-form"]', { timeout: 8000 }).should('be.visible');
});

it('Should open incident from the discover app', { retries: { runMode: 4 } }, () => {
cy.visit(discoverUrl);

cy.disableSmoothScroll();

cy.waitForStableDOM();

cy.get('[data-cy="collapse-button"]:visible').click();

cy.contains('Show Details on Incident #10').first().click();

cy.waitForStableDOM();

cy.url().should('include', '/cite/10');

cy.waitForStableDOM();
});
});
30 changes: 30 additions & 0 deletions site/gatsby-site/cypress/e2e/integration/snapshots.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { conditionalIt } from '../../support/utils';

describe('The Database Snapshots Page', () => {
const url = '/research/snapshots';

it('Successfully loads', () => {
cy.visit(url);
});

conditionalIt(
!Cypress.env('isEmptyEnvironment'),
'Should display a list of snapshots to download',
() => {
cy.visit(url);

cy.get('[data-cy="snapshots-list"] li')
.should('exist')
.and('be.visible')
.and('have.length.gt', 0);

cy.get('[data-cy="snapshots-list"] li').each((item) => {
expect(item[0].innerText).to.match(
/^\d{4}-\d{2}-\d{2} \d{1,2}:\d{2} (AM|PM) · \d+(\.\d{2})? MB · backup-\d{14}\.tar\.bz2$/
);

expect(item.find('a').attr('href')).to.match(/^https:\/\/.*\/backup-\d{14}\.tar\.bz2$/);
});
}
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Social Share buttons on pages', { retries: { runMode: 4 } }, () => {
});
}

urlsToTest.forEach(({ page, url, shareButtonSections }) => {
urlsToTest.forEach(({ page, url, title, shareButtonSections }) => {
it(`${page} page should have ${shareButtonSections} Social Share button sections`, () => {
cy.visit(url);

Expand Down Expand Up @@ -56,9 +56,8 @@ describe('Social Share buttons on pages', { retries: { runMode: 4 } }, () => {
cy.get('@popup_twitter', { timeout: 8000 }).should('be.called');
cy.url().should(
'contain',
`https://twitter.com/i/flow/login?redirect_after_login=%2Fintent%2Ftweet%3Ftext%3D`
`https://twitter.com/intent/tweet?text=${encodeURI(title)}&url=${canonicalUrl}`
);
cy.url().should('contain', `url%3D${encodeURIComponent(canonicalUrl)}`);
});

// LinkedIn share
Expand Down
3 changes: 2 additions & 1 deletion site/gatsby-site/cypress/e2e/integration/submit.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ describe('The Submit form', () => {
.contains(/^YouTube$/)
.click();

cy.get('input[name="deployers"]').type('NewDeployer{enter}');
cy.get('button[type="submit"]').click();

cy.wait('@insertSubmission').then((xhr) => {
Expand All @@ -148,7 +149,7 @@ describe('The Submit form', () => {
"Recent news stories and blog\n\nposts highlighted the underbelly of YouTube Kids, Google's children-friendly version. This is more text to reach the 256 charactrs minimum, becuase otherwise the text by similarity component doesnt fetch, which surprisingly is way more character that I initially imagined when I started writing this.\n",
url: `https://www.arstechnica.com/gadgets/2017/11/youtube-to-crack-down-on-inappropriate-content-masked-as-kids-cartoons/`,
source_domain: `arstechnica.com`,
deployers: { link: ['youtube'] },
deployers: { link: ['youtube', 'newdeployer'] },
});
});

Expand Down
14 changes: 0 additions & 14 deletions site/gatsby-site/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,6 @@ const plugins = [
],
},
},
{
resolve: `gatsby-source-s3`,
options: {
aws: {
// This AWS IAM user has been provisioned no permissions, but the plugin requires a user to
// get a listing of the public S3 bucket. User: backupindexpublic
accessKeyId: 'AKIA25BP4AERUFDGAJUJ',
secretAccessKeyId: 'backupindexpublic',
secretAccessKey: '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',
},
buckets: ['aiid-backups-public'],
// expiration: 120,
},
},
{
resolve: `gatsby-theme-i18n`,
options: {
Expand Down
Loading

0 comments on commit 1fcf7c1

Please sign in to comment.