Skip to content

Commit

Permalink
Merge branch 'main' into OPS-310/3098_can_details_form
Browse files Browse the repository at this point in the history
  • Loading branch information
fpigeonjr authored Dec 11, 2024
2 parents e6279a2 + df0872c commit 2d22f15
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly_scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
uses: SvanBoxel/zaproxy-to-ghas@cfc77481d74a17a4c3d6b753aa9d7abef453d501 # v1.0.2

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3
uses: github/codeql-action/upload-sarif@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions .github/workflows/security_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3
uses: github/codeql-action/init@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3
with:
languages: javascript, python
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -33,4 +33,4 @@ jobs:
queries: +security-extended

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3
uses: github/codeql-action/analyze@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3
4 changes: 2 additions & 2 deletions .github/workflows/security_semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Semgrep Analyze
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep@sha256:14e68d6c5e501b838d07b3f6effc2bf58faf343d9f62cefd1af0108dfe6291df # 1.47.0
image: returntocorp/semgrep@sha256:374d5a678b58e9ba3ef291ce37ffa836f69150a2360c78f02dca7a07bc42fb7d # 1.47.0
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
Expand All @@ -25,7 +25,7 @@ jobs:
SEMGREP_RULES: "p/default"

- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3
uses: github/codeql-action/upload-sarif@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3
with:
sarif_file: ${{ env.SEMGREP_TO_UPLOAD }}
if: always()
2 changes: 1 addition & 1 deletion backend/ops_api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ flake8-black = "==0.3.6"
ipython = "==8.30.0"
isort = "==5.13.2"
nox = "==2024.10.9"
numpy = "==2.1.3"
numpy = "==2.2.0"
pytest = "==8.3.4"
pytest-bdd = "==8.1.0"
pytest-cov = "==6.0.0"
Expand Down
114 changes: 57 additions & 57 deletions backend/ops_api/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/ops_api/ops/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def register_api(api_bp: Blueprint) -> None:
view_func=CHANGE_REQUEST_REVIEW_API_VIEW_FUNC,
)
api_bp.add_url_rule(
"/documents/<int:agreement_id>/",
"/documents/<int:agreement_id>",
view_func=DOCUMENT_API_FUNC,
)
api_bp.add_url_rule(
Expand Down
4 changes: 2 additions & 2 deletions frontend/cypress/e2e/mainPage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ afterEach(() => {
});

it("loads", () => {
cy.get("h1").contains("This is the OPRE OPS system prototype");
cy.get("h1").contains("This is a non-production OPS environment");
});

it("clicking on /cans nav takes you to CAN page", () => {
Expand All @@ -22,7 +22,7 @@ it("clicking on /cans nav takes you to CAN page", () => {
});

it("clicking on /portfolio nav while unauthenticated, should keep you at home page.", () => {
cy.get("h1").contains("This is the OPRE OPS system prototype");
cy.get("h1").contains("This is a non-production OPS environment");
cy.url().should("include", "/");
});

Expand Down
39 changes: 21 additions & 18 deletions frontend/cypress/e2e/uploadDocument.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,27 @@ it("should create a document database record and upload to in memory storage", (
// Verifying the document database record exists
expect(localStorage.getItem("access_token")).to.exist;
const bearer_token = `Bearer ${window.localStorage.getItem("access_token")}`;
cy.request({
method: "GET",
url: "http://localhost:8080/api/v1/documents/1",
headers: {
Authorization: bearer_token,
"Content-Type": "application/json",
Accept: "application/json"
}
}).then((response) => {
expect(response.status).to.eq(200);
expect(response.body.url).to.exist;
expect(response.body.url).to.include("FakeDocumentRepository");
expect(response.body.documents).to.exist;
expect(response.body.documents[0].document_name).to.eq("sample_document.xlsx");
expect(response.body.documents[0].document_type).to.eq("DocumentType.ADDITIONAL_DOCUMENT");
expect(response.body.documents[0].agreement_id).to.eq(1);
expect(response.body.documents[0].status).to.eq("uploaded");
});
cy.wait(2000).then(() => {
cy.request({
method: "GET",
url: "http://localhost:8080/api/v1/documents/1",
headers: {
Authorization: bearer_token,
"Content-Type": "application/json",
Accept: "application/json"
}
}).then((response) => {
expect(response.status).to.eq(200);
expect(response.body.url).to.exist;
expect(response.body.url).to.include("FakeDocumentRepository");
expect(response.body.documents).to.exist;
const mostRecentDoc = response.body.documents.length - 1;
expect(response.body.documents[mostRecentDoc].document_name).to.eq("sample_document.xlsx");
expect(response.body.documents[mostRecentDoc].document_type).to.eq("DocumentType.ADDITIONAL_DOCUMENT");
expect(response.body.documents[mostRecentDoc].agreement_id).to.eq(1);
expect(response.body.documents[mostRecentDoc].status).to.eq("uploaded");
});
})
});

it.skip("Should download document in memory storage and verify logs", () => {
Expand Down
14 changes: 10 additions & 4 deletions frontend/src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ const Home = () => {
return (
<App>
<div className="display-flex flex-justify-center">
<RoundedBox className="margin-top-4 text-center">
<h1>This is the OPRE OPS system prototype</h1>
<p>⚠️Tread with caution</p>
</RoundedBox>
{!import.meta.env.PROD ? (
<RoundedBox className="margin-top-4 text-center">
<h1>This is a non-production OPS environment</h1>
<p>⚠️This environment is not authorized for certain production datasets. Additionally, this environment may be updated regularly.</p>
</RoundedBox>
) : (
<RoundedBox className="margin-top-4 text-center">
<h1>Welcome to OPS!</h1>
</RoundedBox>
)}
</div>
</App>
);
Expand Down

0 comments on commit 2d22f15

Please sign in to comment.