Skip to content

Commit

Permalink
Merge pull request #2057 from fecgov/release/sprint-45
Browse files Browse the repository at this point in the history
Release/sprint 45
  • Loading branch information
mjtravers authored Jul 22, 2024
2 parents 43fcd9c + 38b71ec commit f91d542
Show file tree
Hide file tree
Showing 29 changed files with 266 additions and 81 deletions.
27 changes: 12 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,11 @@ jobs:
command: |
rm -rf /tmp/cypress
mkdir -p /tmp/cypress/results
mkdir -p /tmp/cypress/lighthouse
mkdir -p /tmp/cypress/videos
docker cp fecfile-web-app-e2e:/root/fecfile-web-app/front-end/cypress/results/. /tmp/cypress/results
docker cp fecfile-web-app-e2e:/root/fecfile-web-app/front-end/cypress/lighthouse/. /tmp/cypress/lighthouse
docker cp fecfile-web-app-e2e:/root/fecfile-web-app/front-end/cypress/videos/. /tmp/cypress/videos
docker rm fecfile-web-app-e2e
- store_artifacts:
path: /tmp/cypress/results
destination: cypress/results
- store_artifacts:
path: /tmp/cypress/lighthouse
destination: cypress/lighthouse
- store_artifacts:
path: /tmp/cypress/videos
destination: cypress/videos
deploy-job:
docker:
- image: cimg/node:20.4.0-browsers
Expand Down Expand Up @@ -318,7 +308,9 @@ parameters:
workflows:
primary:
when:
not: << pipeline.parameters.is-nightly-run >>
and:
- not: << pipeline.parameters.is-nightly-run >>
- not: << pipeline.parameters.is-triggered-e2e-test >>
jobs:
- lint
- test
Expand All @@ -327,18 +319,23 @@ workflows:
filters:
branches:
only: /develop|release\/sprint-[\.\d]+|main/
- deploy-job: # Deploy job with requires dependencies which may not always run
name: deploy-job-conditional
- deploy-job: # All dependencies must pass before deploying
name: deploy-with-all-dependent-jobs-required
requires:
- lint
- test
- dependency-check
# - e2e-test
filters:
branches:
only:
- develop
- deploy-job: # Deploy job with no requires dependencies which will always run
name: deploy-job-always
- deploy-job: # Deploy job even when e2e tests fail
name: deploy-even-if-e2e-job-fails
requires:
- lint
- test
- dependency-check
filters:
branches:
only: /release\/sprint-[\.\d]+|main/
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,14 @@ Set up git secrets to protect oneself from committing sensitive information such
### Commit local code changes to origin daily

As a best practice policy, please commit any feature code changes made during the day to origin each evening before signing off for the day.

### Snyk security scanning
A Snyk online account has been set up for FEC to monitor the FECFile Online GitHub repositories. The management of vulnerability alerts will be handled as a weekly rotating task performed by a developer who will log into the [Snyk Dashboard](https://app.snyk.io/invite/link/accept?invite=93042de6-4eca-4bb5-bf76-9c2e9f895e24&utm_source=link_invite&utm_medium=referral&utm_campaign=product-link-invite&from=link_invite) and perform the following tasks:

1. Review the vulnerability reports for each of the FECFile Online GitHub repository.
2. Write up a ticket (1 for each reported "Critical" or "High" severity vulnerability) to remediate the vulnerability.
3. Point and mark each ticket with the following tags: "security", "high priority".
4. Move each new ticket into the current sprint and sprint backlog.
5. Update weekly assignment log with tickets created or "None".

The weekly assignment log can be found in the Google drive 🔒 [here](https://docs.google.com/spreadsheets/d/1SNMOyGS4JAKgXQ0RhhzoX7M2ib1vm14dD0LxWNpssP4) 🔒
6 changes: 1 addition & 5 deletions deploy-config/fecfile-web-app-dev-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ applications:
memory: 1G
buildpack: nginx_buildpack
stack: cflinuxfs4

routes:
- route: fecfile-web-app-dev.app.cloud.gov

env:
EXAMPLE: example
- route: dev.fecfile.fec.gov
6 changes: 1 addition & 5 deletions deploy-config/fecfile-web-app-prod-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ applications:
memory: 1G
buildpack: nginx_buildpack
stack: cflinuxfs4

routes:
- route: fecfile-web-app-prod.app.cloud.gov

env:
EXAMPLE: example
- route: fecfile.fec.gov
6 changes: 1 addition & 5 deletions deploy-config/fecfile-web-app-stage-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ applications:
memory: 1G
buildpack: nginx_buildpack
stack: cflinuxfs4

routes:
- route: fecfile-web-app-stage.app.cloud.gov

env:
EXAMPLE: example
- route: stage.fecfile.fec.gov
15 changes: 11 additions & 4 deletions front-end/.snyk
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
version: v1.22.1
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-NGXBOOTSTRAP-174319:
'SNYK-JS-BOOTSTRAP-7444580':
- '*':
reason: None Given
expires: 2022-03-19T21:41:00.684Z
created: 2022-02-17T21:41:00.692Z
reason: 'No upgrade or patch available'
expires: 2024-11-01T21:41:00.684Z
'SNYK-JS-BOOTSTRAP-7444593':
- '*':
reason: 'No upgrade or patch available'
expires: 2024-11-01T21:41:00.684Z
'SNYK-JS-BOOTSTRAP-7444617':
- '*':
reason: 'No upgrade or patch available'
expires: 2024-11-01T21:41:00.684Z
patch: {}
8 changes: 5 additions & 3 deletions front-end/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import * as fs from 'fs';
export default defineConfig({
defaultCommandTimeout: 10000,
projectId: 'x5egpz',
video: true,
video: false,
videosFolder: 'cypress/videos',
screenshotsFolder: 'cypress/screenshots',
screenshotOnRunFailure: true,
screenshotOnRunFailure: false,
fixturesFolder: 'cypress/fixtures',
trashAssetsBeforeRuns: false,
viewportHeight: 768,
viewportWidth: 1366,
videoUploadOnPasses: false,
chromeWebSecurity: false,
reporter: 'mochawesome',
Expand All @@ -25,7 +27,7 @@ export default defineConfig({
options: ['--chrome-flags="--no-sandbox --headless --disable-gpu"'],
},
retries: {
runMode: 2,
runMode: 1,
openMode: 0,
},
e2e: {
Expand Down
5 changes: 3 additions & 2 deletions front-end/cypress/e2e/F1M/f1m-affiliation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ describe('Manage reports', () => {

it('should create form 1m by affiliation', () => {
ContactListPage.createCommittee();
const committeeID = Cypress.env('COMMITTEE_ID');
ReportListPage.createF1M();
PageUtils.valueCheck('[data-cy="committee-id-input"]', 'C00601211');
PageUtils.valueCheck('[data-cy="committee-id-input"]', committeeID);
cy.get('[data-cy="state-party-radio"]').click();
cy.get('[data-cy="affiliation-radio"').click();
cy.get('[id="searchBox"]').type(committeeFormData.committee_id.slice(0, 3));
Expand All @@ -35,7 +36,7 @@ describe('Manage reports', () => {
return candidate;
});
ReportListPage.createF1M();
PageUtils.valueCheck('[data-cy="committee-id-input"]', 'C00601211');
PageUtils.valueCheck('[data-cy="committee-id-input"]', 'C99999999');
cy.get('[data-cy="state-party-radio"]').click();
cy.get('[data-cy="qualification-radio"').click();
cy.get('[data-cy="qualification-radio"').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { StartTransaction } from '../F3X/start-transaction/start-transaction';
import { faker } from '@faker-js/faker';
import { F24Setup } from './f24-setup';
import { ReportListPage } from '../pages/reportListPage';
import { defaultForm3XData } from '../models/ReportFormModel';

const independentExpenditureData: DisbursementFormData = {
...defaultTransactionFormData,
Expand All @@ -29,7 +30,11 @@ describe('Form 24 Independent Expenditures', () => {
});

it('Independent Expenditures created on a Form 24 should be linked to a Form 3X', () => {
F3XSetup({ individual: true, candidate: true });
const f3x_report_data = {
...defaultForm3XData,
cash_on_hand: 500,
};
F3XSetup({ individual: true, candidate: true, report: f3x_report_data });
F24Setup();
StartTransaction.IndependentExpenditures().IndependentExpenditure();

Expand Down
2 changes: 2 additions & 0 deletions front-end/cypress/e2e/F3X/reports-f3x-amendments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ describe('Amendments', () => {
PageUtils.clickSidebarItem('SUBMIT YOUR REPORT');
PageUtils.clickLink('Submit report');
PageUtils.urlCheck('/submit/step2');
PageUtils.enterValue('#treasurer_last_name', 'TEST');
PageUtils.enterValue('#treasurer_first_name', 'TEST');
PageUtils.enterValue('#filingPassword', Cypress.env('FILING_PASSWORD')); // Insert password from env variable
cy.get(alias).find('.p-checkbox-box').first().click();
PageUtils.clickButton('Submit');
Expand Down
4 changes: 2 additions & 2 deletions front-end/cypress/e2e/F3X/reports-f3x-loans-bank.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('Loans', () => {
.children()
.last()
.click();
cy.get(alias).contains('New loan agreement').click();
cy.get(alias).contains('New loan agreement').click({ force: true });

PageUtils.urlCheck('/C1_LOAN_AGREEMENT');
PageUtils.searchBoxInput(organizationFormData.name);
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('Loans', () => {
.children()
.last()
.click();
cy.contains('Review loan agreement').click();
cy.contains('Review loan agreement').click({ force: true });
PageUtils.urlCheck('/list/');
PageUtils.valueCheck('#amount', '$65,000.00');
PageUtils.valueCheck('#date_incurred', '05/27/2024');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ export class StartTransaction {

static Loans() {
PageUtils.clickSidebarItem('Add loans and debts');
cy.contains('LOANS').should('exist');
PageUtils.clickLink('LOANS');
return Loans;
}

static Debts() {
PageUtils.clickSidebarItem('Add loans and debts');
cy.contains('DEBTS').should('exist');
PageUtils.clickLink('DEBTS');
return Debts;
}
Expand Down
2 changes: 2 additions & 0 deletions front-end/cypress/e2e/models/ReportFormModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class F3xCreateReportFormData {
coverage_through_date: Date;
date_of_election: Date;
state_of_election: string;
cash_on_hand?: number;

constructor(formData: F3xCreateReportFormData) {
this.filing_frequency = formData.filing_frequency;
Expand All @@ -17,6 +18,7 @@ export class F3xCreateReportFormData {
this.coverage_from_date = formData.coverage_from_date;
this.date_of_election = formData.date_of_election;
this.state_of_election = formData.state_of_election;
this.cash_on_hand = formData.cash_on_hand;
}
}

Expand Down
10 changes: 5 additions & 5 deletions front-end/cypress/e2e/pages/loginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ function legacyLogin() {
const fieldCommittee = '#committeeId';
const fieldPassword = '#loginPassword';

cy.fixture('FEC_Get_Committee_Account').then(() => {
cy.intercept('POST', 'http://localhost:8080/api/v1/user/login/authenticate').as('GetLoggedIn');
cy.intercept('GET', `http://localhost:8080/api/v1/openfec/${committeeID}/committee`).as('GetCommitteeAccounts');
cy.intercept('POST', 'http://localhost:8080/api/v1/committees/*/activate/').as('ActivateCommittee');
});
cy.intercept('POST', 'http://localhost:8080/api/v1/user/login/authenticate').as('GetLoggedIn');
cy.intercept('GET', `http://localhost:8080/api/v1/openfec/${committeeID}/committee`, {
fixture: 'FEC_Get_Committee_Account',
}).as('GetCommitteeAccounts');
cy.intercept('POST', 'http://localhost:8080/api/v1/committees/*/activate/').as('ActivateCommittee');

cy.visit('/');
cy.get('#dropdownMenuButton').click();
Expand Down
1 change: 1 addition & 0 deletions front-end/cypress/e2e/pages/profileAccountPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export class ProfileAccountPage {
static goToPage() {
cy.intercept('/profile').as('account');
cy.visit('/dashboard');

cy.get('#navbarProfileDropdownMenuLink').click();
cy.get('[href="/committee"]').contains('Account').click();
cy.location('pathname').should('include', '/committee');
Expand Down
17 changes: 10 additions & 7 deletions front-end/cypress/e2e/pages/reportListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@ export class ReportListPage {
static deleteAllReports() {
cy.getCookie('csrftoken').then((cookie) => {
cy.request({
method: 'GET',
url: 'http://localhost:8080/api/v1/reports/',
method: 'POST',
url: 'http://localhost:8080/api/v1/reports/e2e-delete-all-reports/',
headers: {
'x-csrftoken': cookie?.value,
},
}).then((resp) => {
const reports = resp.body;
for (const report of reports) {
ReportListPage.deleteReport(report.id);
}
});
});
}
Expand All @@ -56,6 +51,14 @@ export class ReportListPage {
F3xCreateReportPage.waitForCoverage();
F3xCreateReportPage.enterFormData(fd);
PageUtils.clickButton('Save and continue');
if (fd.cash_on_hand) {
F3xCashOnHandPage.enterFormData({
cashOnHand: fd.cash_on_hand.toString(),
date: fd.coverage_from_date,
});
PageUtils.clickButton('Save & continue');
cy.contains('Transactions in this report').should('exist');
}
}

static createF1M() {
Expand Down
2 changes: 1 addition & 1 deletion front-end/cypress/e2e/profile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Manage profile', () => {
ProfileAccountPage.goToPage();
cy.runLighthouse('profile', 'account-info');

cy.contains('C00601211').should('exist');
cy.contains('C99999999').should('exist');
});

it('Can view the Users table', () => {
Expand Down
2 changes: 1 addition & 1 deletion front-end/cypress/fixtures/FEC_Get_Committee_Account.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"custodian_name_title":null,
"party":null,
"treasurer_city":"Testville",
"committee_id":"C00277608",
"committee_id":"C99999999",
"lobbyist_registrant_pac":null,
"treasurer_state":null,
"leadership_pac":null,
Expand Down
1 change: 1 addition & 0 deletions front-end/cypress/fixtures/FEC_Get_F1_Filing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"additional_bank_names":null,"amendment_chain":null,"amendment_indicator":"A","amendment_version":null,"bank_depository_city":null,"bank_depository_name":null,"bank_depository_state":null,"bank_depository_street_1":null,"bank_depository_street_2":null,"bank_depository_zip":null,"beginning_image_number":"99999999999","candidate_id":null,"candidate_name":null,"cash_on_hand_beginning_period":null,"cash_on_hand_end_period":null,"committee_id":"C99999999","committee_name":"FECFILE E2E TEST COMMITTEE","committee_type":"Q","coverage_end_date":null,"coverage_start_date":null,"csv_url":null,"cycle":1994,"debts_owed_by_committee":null,"debts_owed_to_committee":null,"document_description":"Statement of Organization 1993","document_type":null,"document_type_full":null,"election_year":null,"ending_image_number":"99999999999","fec_file_id":null,"file_number":null,"form_category":"STATEMENT","form_type":"F1","house_personal_funds":null,"html_url":null,"is_amended":null,"means_filed":"paper","most_recent":null,"most_recent_file_number":null,"net_donations":null,"office":null,"opposition_personal_funds":null,"pages":3,"party":null,"pdf_url":null,"previous_file_number":null,"primary_general_indicator":null,"receipt_date":"1993-12-27T00:00:00","report_type":null,"report_type_full":null,"report_year":1993,"request_type":null,"senate_personal_funds":null,"state":null,"sub_id":"9999999999999999999","total_communication_cost":null,"total_disbursements":null,"total_independent_expenditures":null,"total_individual_contributions":null,"total_receipts":null,"treasurer_name":"TESTERSON GEORGE","update_date":"2002-03-30"}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@
</ul>
</li>
<li class="nav-item" [ngClass]="full ? 'full-width' : ''">
<a class="nav-link" routerLink="#">
<a class="nav-link disabled" routerLink="#" p-disabled>
<!--
The greying of the bell icon is handled by an scss filter
since the usual disabled class doesn't work on image files
-->
<img
class="header-navbar-icon"
class="header-navbar-icon header-navbar-icon-disabled"
ngSrc="assets/img/notification_bell_icon.svg"
alt="Notifications"
[height]="16 * ratio"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@
.nav-link.disabled:hover {
cursor: default;
}

.header-navbar-icon-disabled {
filter: (invert(100%) sepia(100%) saturate(0%) brightness(135%));
}
Loading

0 comments on commit f91d542

Please sign in to comment.