Coder Social home page Coder Social logo

bcgov / nrpti Goto Github PK

View Code? Open in Web Editor NEW
5.0 14.0 15.0 16.49 MB

Natural Resources Public Transparency Initiative

License: Apache License 2.0

JavaScript 39.89% TypeScript 42.05% HTML 12.26% Groovy 0.26% Dockerfile 0.02% Shell 0.01% SCSS 5.51% Makefile 0.01%
transparency-initiative natural-resources nodejs angular typescript mongodb javascript empr env

nrpti's Introduction

API tests Front-End tests

NRPTI

Natural Resources Public Transparency Initiative monorepo. This supports the LNG Regulatory interface, Natural Resource Compliance and Enforcement Database, and soon the BC Mines Information site.

Environments

PUBLIC-NRCED

https://nrced.gov.bc.ca/

NRPTI API/ADMIN

https://nrpti-f00029-prod.apps.silver.devops.gov.bc.ca/

METABASE

https://metabase-f00029-prod.apps.silver.devops.gov.bc.ca/

ClamAV

All documents uploaded to the NRPTI system are first checked by the ClamAV anti-virus service and rejected if they do not pass. See ClamAV BCGov Repo for more information.

Running it locally

Please see the READMEs in the angular/ and api/ subdirectories.

VSCode Extensions

A list of recommended/helpful VS Code extensions.

Linting/Formatting

  • TSLint
  • ESLint
  • Prettier - Code formatter
  • EditorConfig for VS Code

Languages

  • npm
  • Angular Extension pack
    • This may include 'Beautify' which should be disabled as we are using Prettier.
  • JavaScript (ES6) code snippets

Doc + Comments

  • Document This
  • Better Comments
  • Code Spell Checker
  • Auto Comment Blocks

General

  • Auto-Open Markdown Preview
  • Bracket Pair Colorizer
  • Path intellisense
  • SCSS intellisense
  • Shell launcher

Other

  • Declarative Jenkinsfile Support

How to Contribute

Fork the repo and create pull requests against the master branch.

nrpti's People

Contributors

acatchpole avatar amichard avatar bcgovneal avatar cameronpettit avatar christopher-walsh22 avatar davidclaveau avatar dependabot[bot] avatar dhlevi avatar dmitri-korin-bcps avatar fergmac avatar itchison avatar julianforeman avatar kitarmstrong avatar lenastachiw avatar localnewstv avatar lolandae avatar marklise avatar maxwardle avatar mtcarto avatar nickphura avatar norrisng-bc avatar pinkyandthekane avatar plasticviking avatar repo-mountie[bot] avatar sanjaytkbabu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nrpti's Issues

Update "Issuing Agency" in NCRED

As a NRCED User I want The issuing agency to reflect the new names of the gov't organizations So That any data parsed into the DB is attributed to the correct agency

Additional Context

  • FLNRO and the natural resource ministries are being rearranged, as a part of that some ministry and division names are changing
  • This ticket is to reflect how those name changes will affect NCRED

Acceptance Criteria

  • Given data is imported from a csv, When the issuing agency is would be assigned to now defunct ministry, Then the issuing agency should be changed to the new ministry name
  • Given data is imported via an automated import, When the issuing agency is would be assigned to now defunct ministry, Then the issuing agency should be changed to the new ministry name
  • Given data is imported manually, When the user selects a issuing agency from the drop down, Then the issuing agency drop down should only include the correct (new ministry names)

Excel file with the changes:
https://app.zenhub.com/files/215895714/cdc30af6-1a80-4efc-820a-9788182fcdfb/download

Document Formatting Requirements of CSV documents for the Manual Importer - NRPTI

Describe the task
Learn NRPTI code to see what the formatting and entry requirements are for different CSV documents

Acceptance Criteria

  • to provide documentation on formatting and entry requirements to Service Owner
  • second
  • third

Additional context

  • From Jack - Sep 20/22
    Unfortunately, we've been having some issues where an import of a csv file does not result in the full display of all the fields. I've done some testing and it seems the import works if specific terms are used like "fined" instead of "fined for x". Would it be possible to do some research in the NRPTI code to see what the formatting and entry requirements are for different csv documents (particularly the COORS source system for court cases, which is what I'm working on now). I would really appreciate knowing what those formatting and entry requirements are for all the CSV because there's no documentation!!!

Explore how NRPTI is using KeyCloak

Describe the task
Explore the use of Keycloak with NRPTI.

Acceptance Criteria

  • How is NRPTI using Keycloak to provision access to the application
  • Are they using Realm level roles or Client level roles
  • How complex is the integration with Keycloak

Additional context

  • when we meet with the Keycloak team, they essentially want to know if a Keycloak realm can be moved to a common realm and only use client level roles/user groups
  • this work is related to the SSO team's attempt to reduce the total amount of custom Keycloak Realms

General information
NEEDS NRPTI KEYCLOAK LINK
https://developer.okta.com/blog/2017/07/25/oidc-primer-part-1
https://github.com/bcgov/sso-keycloak/wiki/zorin-notes-to-run-examples-from-our-team
https://bcgov.github.io/sso-requests
https://github.com/bcgov/sso-keycloak/wiki/test-page

Identify Document Location When Manually Attached to Record in NRPTI

As a Service Owner/NRPTI User I want to know where a document is stored when it is manually attached to a record in NRPTI so that we still have access to the document if NRIS fails.

Additional Context

  • enter text here
  • enter text here

Acceptance Criteria

  • Given (Context), When (action carried out), Then (expected outcome)
  • Given (Context), When (action carried out), Then (expected outcome)

add info to find permit record on top of NRCED landing page

As a NRCED front end user I want (Feature/enhancement) So That (Value, why is this wanted, what is the user trying to accomplish)

Additional Context

Acceptance Criteria

  • Given a user has landed on the NRCED homepage, When they read the messaging “Use the keyword… specific records.”, Then the user should see a message below stating: “For compliance and enforcement actions under the Environmental Management Act and the Integrated Pest Management Act, the permit number in the record may be used to find a copy of the permit in the Authorization Management System.”

  • "Authorization Management System" should hyperlink to https://j200.gov.bc.ca/pub/ams/Default.aspx?PossePresentation=DocumentSearch

It's Been a While Since This Repository has Been Updated

This issue is a kind reminder that your repository has been inactive for 180 days. Some repositories are maintained in accordance with business requirements that infrequently change thus appearing inactive, and some repositories are inactive because they are unmaintained.

To help differentiate products that are unmaintained from products that do not require frequent maintenance, repomountie will open an issue whenever a repository has not been updated in 180 days.

  • If this product is being actively maintained, please close this issue.
  • If this repository isn't being actively maintained anymore, please archive this repository. Also, for bonus points, please add a dormant or retired life cycle badge.

Thank you for your help ensuring effective governance of our open-source ecosystem!

Dockerfile Nonexistant Branch Checkout in WALLY

Additional context
/backend/dockerfile.dev has a git checkout command that causes the build to fail because the branch it references does not exist.

Definition of Done

  • Remove deprecated git checkout command

NRPTI Monitoring Review

Describe the task
Review Repo, understand what type of monitoring exists for the app, what it would take to set it up, and what is missing.

Acceptance Criteria

  • first
  • second
  • third

Additional context

  • Add any other context about the task here.
  • Or here

Fix Permissions For GWELLS Database Read Only Account

Describe the task
The read only account that the Service Owner uses to access the database is missing permissions that allow it to do sql queries.

Acceptance Criteria

  • Edit permissions for Postgres account to allow sql queries to be run.
  • Test the account in the production database.

Setup Github Actions for NRPTI/NRCED

Describe the task
The Jenkins Pipeline for NRPTI is failing and we do not have knowledge or resources to repair and make it work, instead we will focus on shifting to a Github Actions Pipeline for this product.

Acceptance Criteria

  • understanding existing Jenkins pipeline configuration
  • build frontend as a docker image
  • build backend as a docker image
  • understand the full scope of setting up github actions as the new pipeline for NRPTI
  • copy over Openshift commands to Github Actions scripts
  • translate existing build container steps in Jenkins to Github Actions
  • use Github Actions to push to Dev environment
  • use Github Actions to push to Test environment
  • use Github Actions to push to Prod environment

Additional context

  • We may be able to get assistance from the PSU Devs, or DevOps Specialists, or Common Services Team
  • the bulk of this is moving the configuration from Jenkins to Github Actions

Update CentOS

Additional context
CentOS 8 is not supported anymore so the app cannot build locally unless you do a hacky fix for it.

Definition of Done

  • Update CentOS to working version
  • Remove code hack that uses vaulted version to run
  • Make sure new version doesn't create errors / write tickets for errors it creates

Update Build Scripts

Describe the task
Some applications have outdated versions of dependencies they use. These have to be updated so the application can be built more intuitively.

Acceptance Criteria

  • Check code bases for outdated files
  • Update outdated files to more current versions
  • Update build scripts to match new file versions

Additional context

  • Known apps that require changes: GWELLS/Wally
  • This excludes all NMP apps

Determine Cause for Importers Failing Randomly - NRPTI

Describe the Bug
In Prod and in Test, the importers will sometimes fail and will need to be re-run. The reason for failure is unclear.

Expected Behaviour
The importers successfully pull the data they're supposed to.

Actual Behaviour
On occasion, the importer does not successfully pull the data.

Implications
Created additional work for employees. Bad reputation for application.

** Steps To Reproduce**
Steps to reproduce the behaviour:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Additional Context
We need to know what a failure looks like (what messages pop up, what's not happening, etc.)

aim Users of LNG at new source for Information

As an LNG User I want information displayed on the front page telling me where i should go to get the info formerly posted to LNG So That I dont waste time looking for it in the wrong place

Additional Context

  • we want to add text that states LNG is no longer being maintained and provide links to the places users can get the information they seek.
  • the links are: < to be added >

Acceptance Criteria

  • Given A user goest to the LNG Site, When they look at the homepage, Then (they see a bold message stating that LNG is no longer being used and they need to go to the OGC or EAO site to find the information they seek.

Restore database to previous version - NRPTI

Describe the task
Restore the database to previous version as a fail-safe in case something is deployed that damages the database.

Acceptance Criteria

  • Identify how to restore this particular type of database (Mongo DB)
  • Attempt to restore
  • Document how to restore database for other developers

Additional context

Fix tagging issue preventing NRPTI build getting to Test & Prod

Describe the task
Before we can make changes to the NRPTI Pipeline to push from Dev to Test we need to fix the tagging issue on the build.

Acceptance Criteria

  • build can be tagged appropriately for test environment
  • build can be tagged appropriately for production environment
  • create a ticket for any other issues/errors found along the way

Additional context

  • a known failure is that the new build exists in production but openshift uses a build that is tagged as "nrpti:prod" and when the build goes to openshift by default it is tagged as "latest", thats why it appears in dev but not in prod, because dev uses "latest" not a custom tag
  • Ext devs that have been consulted on this: Sybrand, Derek, Conor

Update Readme(s)

Describe the task
Most applications have outdated setup documentation that will need to be updated.

Acceptance Criteria

  • Check if there is a difference between readme(s) and setup processes
  • Update setup steps in readme(s)

Additional context

  • Invasives app might be the only one that doesn't need updating
  • This excludes all NMP apps
  • This is partially blocked by the updating build ticket #964

Investigate if Certbot renewal is automated for NRPTI

As a Service Owner I want automated certificate renewals So That our digital service doesn't display "your connection is not private" messaging

Additional Context

The cert expired in March and magically renewed (at a later date). Prevailing theory is that Certbot is automated. but for the wrong date.

Acceptance Criteria

  • Is Certbot automated for NRPTI?
  • If Certbot is automated for NRPTI, does the renewal date align with the cert expiration?

Investigate if Certbot renewal is automated for NRCED

As a Service Owner I want automated certificate renewals So That our digital service doesn't display "your connection is not private" messaging

Additional Context

The cert expired in March and magically renewed (at a later date). Prevailing theory is that Certbot is automated. but for the wrong date.

Acceptance Criteria

  • Is Certbot automated for NRCED?
  • If Certbot is automated for NRCED, does the renewal date align with the cert expiration?

Explore how NRCED is using Keycloak

Describe the task
Explore the use of Keycloak with NRCED.

Acceptance Criteria

  • How is NRCED using Keycloak to provision access to the application
  • Are they using Realm level roles or Client level roles
  • How complex is the integration with Keycloak

Additional context

  • when we meet with the keycloak team, they essentially want to know if a keycloak realm can be moved to a common realm and only use client level roles/user groups
  • this work is related to the SSO team's attempt to reduce the total amount of custom Keycloak Realms

General information
THE LINKS BELOW WERE COPIED FROM #969. TO BE UPDATED SO THEY ARE RELEVANT TO NRCED
https://developer.okta.com/blog/2017/07/25/oidc-primer-part-1
https://github.com/bcgov/sso-keycloak/wiki/zorin-notes-to-run-examples-from-our-team
https://oidc.gov.bc.ca/auth/realms/3l5nw6dk/protocol/openid-connect/auth?client_id=security-admin-console&redirect_uri=https%3A%2F%2Foidc.gov.bc.ca%2Fauth%2Fadmin%2F3l5nw6dk%2Fconsole%2F%23%2Frealms%2F3l5nw6dk%2Fusers&state=b35d72b3-d487-41e6-b8f4-030c87810952&response_mode=fragment&response_type=code&scope=openid&nonce=28d12c81-4f7e-49e7-8f22-a30dfba98b30&code_challenge=hkrkKMG3xjEgl5xGKZyZoZ3nzKAZ-o9PimvHuJSEMY4&code_challenge_method=S256
https://bcgov.github.io/sso-requests
https://github.com/bcgov/sso-keycloak/wiki/test-page

Research How to Turn on Importer from EMLI to NRPTI

Describe the task
NRPTI pulls data from NRIS-EMLI db and sends it to NRCED and BCMI.

Research on how to “turn on” the importer from NRIS-EMLI to NRPTI: The importer that brings in data from NRIS-EMLI has been left inactive. we need to identify how to turn this on in September when NRIS-EMLI and BCMI are ready. The information is apparently in the NRPTI Repo.

Acceptance Criteria

  • Identified what needs to be done
  • Make a User Story ticket to describe the changes
  • determine if the uploader will upload to both BCMI and NRCED

Additional context

  • db we are connecting to is called "NRIS-EMLI"
  • This is a timed interval CRON job
  • Work for this has already been done
  • the team at EMLI and the old developer and Service Owner confirmed that the BCMI to NRPTI “switch” should be connecting to a database called “NRIS-EMLI”.
  • One thing we’re not certain of is if there will be an option to automatically upload documents from NRIS-EMLI as well as the metadata (it should be configured for just the metadata).
  • We can use Service Owner to test out that things are doing what they are supposed to on the user side

Shut off LNG

Describe the task
LNG (a Separate App) that uses NRPTI is no longer needed and we have been asked to shut it down

Acceptance Criteria

  • understand what needs to be done in order to shut down LNG
  • Understand what implications there are for NRPTI (if any) if LNG is shut down.
  • replace LNG with a page linking to the new sources of this information (Darren Beaupre)
  • test NRCED/NRPTI (Test env) with Jack to ensure there are no issues

Additional context

  • LNG only Pulls data from NRPTI is does not push anything to it

Follow-Up Meeting with SO and Tier 2 - NRPTI

Describe the task
Follow-up meeting with NRPTI and Tier 2 folks.

Purpose
To further discuss the issue after gathering more information re: GET request to an API and input from mid-tier and DBA.

Acceptance Criteria

  • To understand what is needed to change the record order, test and complete the task (#995)

Additional context

  • Half hour meeting with Jack, Nadine, Matt B, Jake, Julian and Norris booked for Nov 3. Jack's predecessor, Kyle will also be in attendance.
  • BSD ticket SD-49498

Add project lifecycle badge

No Project Lifecycle Badge found in your readme!

Hello! I scanned your readme and could not find a project lifecycle badge. A project lifecycle badge will provide contributors to your project as well as other stakeholders (platform services, executive) insight into the lifecycle of your repository.

What is a Project Lifecycle Badge?

It is a simple image that neatly describes your project's stage in its lifecycle. More information can be found in the project lifecycle badges documentation.

What do I need to do?

I suggest you make a PR into your README.md and add a project lifecycle badge near the top where it is easy for your users to pick it up :). Once it is merged feel free to close this issue. I will not open up a new one :)

Request SSO integration - Wally

Describe the task
Request SSO integration. Process is largely automated except for part related to BCeID.

Acceptance Criteria

  • Request is created and accepted by SSO team

Additional context

Identify Document Location When Uploaded via NRIS-EPD Uploader - NRPTI

As a Service Owner/NRPTI User I want to know where a document is stored when it is uploaded as part of the NRIS-EPD uploader so that we still have access to the document if NRIS fails.

Additional Context

  • enter text here
  • enter text here

Acceptance Criteria

  • Given (Context), When (action carried out), Then (expected outcome)
  • Given (Context), When (action carried out), Then (expected outcome)

Setup Sustainment Apps Locally

Describe the task
onboarding to the sustainment team requires setting up each of the digital services we support locally s an initial step

Acceptance Criteria

  • Setup GWELLS
  • Setup NRPTI
  • Setup Inspect
  • Setup NMP-ARM
  • Setup WALLY

Additional context

  • read mes and build scripts are up to date so no updating should be required

Research Upgrading Keycloak to Gold Common Realm for NRPTI

Describe the task
To research and understand how to switch the Keycloak realm the application is using

Acceptance Criteria

  • We understand how Keycloak is being used by this application
  • The functionality can be replicated with Client level roles
  • We understand the work involved from our end to switch the Keycloak realm an app is using

Additional context

Delete CSV file - NRPTI

Describe the task
Delete an error-filled CSV file from NRPTI database. Date is December 18 2023, Only record with that date.

Purpose
The uploaded file was filled with errors. If not possible to upload a corrected document, the best solution is to delete the CSV.

Acceptance Criteria

  • CSV file with errors is removed from NRPTI

Additional context

  • record could be in two places - mongodb and amazon s3 buckets
  • try creating document in staging environment and delete it. if no side effect, delete in prod
  • alternate plan: change the date of record, then remove the data from the record
  • Info from Jack:
    The issue is fortunately not a functionality issue, but instead it's a data issue. One of our users uploaded a csv file with many many errors. We are looking into this, but it's likely not possible for us to uploaded a corrected document (which would be the ideal way to fix this). What we're hoping for is for the csv file itself to be deleted in NRPTI.
    MicrosoftTeams-image.png

NRPTI - Identify and fix where build is initially failing

Describe the task
Get access to NRPTI OpenShift namespace and identify and fix where build is failing.

Acceptance Criteria

  • Run pipeline and see where build is failing (identify errors)
  • Identify and fix initial failure
  • Create ticket(s) for any additional non-trivial failures

Additional context

  • If fixing additional failure(s) is quicker than writing a new ticket for it, just fix it

Set up NRCED/NRPTI

Describe the task
Developers have NRCED/NRPTI set up locally.

Acceptance Criteria

  • Set up front end
  • Set up back end
  • Test digital service (aka app) locally

Additional context
N/A

Set Up NRCED

Describe the task
Developers have NRCED set up locally.

Acceptance Criteria

  • Set up front end
  • Set up back end
  • Test digital service (aka app) locally

Additional context
N/A

Deploy NRPTI to Staging/Test

Describe the task
Currently NRPTI builds and deploys to Dev but does not deploy to any other environments, as a first step we want to try and get NRPTI to push the build from Dev to Test/Staging env.

Acceptance Criteria

  • First
  • second
  • third

Additional context

  • Add any other context about the task here.
  • Or here

Add missing topics

TL;DR

Topics greatly improve the discoverability of repos; please add the short code from the table below to the topics of your repo so that ministries can use GitHub's search to find out what repos belong to them and other visitors can find useful content (and reuse it!).

Why Topic

In short order we'll add our 800th repo. This large number clearly demonstrates the success of using GitHub and our Open Source initiative. This huge success means its critical that we work to make our content as discoverable as possible; Through discoverability, we promote code reuse across a large decentralized organization like the Government of British Columbia as well as allow ministries to find the repos they own.

What to do

Below is a table of abbreviation a.k.a short codes for each ministry; they're the ones used in all @gov.bc.ca email addresses. Please add the short codes of the ministry or organization that "owns" this repo as a topic.

add a topic

That's in, you're done!!!

How to use

Once topics are added, you can use them in GitHub's search. For example, enter something like org:bcgov topic:citz to find all the repos that belong to Citizens' Services. You can refine this search by adding key words specific to a subject you're interested in. To learn more about searching through repos check out GitHub's doc on searching.

Pro Tip 🤓

  • If your org is not in the list below, or the table contains errors, please create an issue here.

  • While you're doing this, add additional topics that would help someone searching for "something". These can be the language used javascript or R; something like opendata or data for data only repos; or any other key words that are useful.

  • Add a meaningful description to your repo. This is hugely valuable to people looking through our repositories.

  • If your application is live, add the production URL.

Ministry Short Codes

Short Code Organization Name
AEST Advanced Education, Skills & Training
AGRI Agriculture
ALC Agriculture Land Commission
AG Attorney General
MCF Children & Family Development
CITZ Citizens' Services
DBC Destination BC
EMBC Emergency Management BC
EAO Environmental Assessment Office
EDUC Education
EMPR Energy, Mines & Petroleum Resources
ENV Environment & Climate Change Strategy
FIN Finance
FLNR Forests, Lands, Natural Resource Operations & Rural Development
HLTH Health
FLNR Indigenous Relations & Reconciliation
JEDC Jobs, Economic Development & Competitiveness
LBR Labour Policy & Legislation
LDB BC Liquor Distribution Branch
MMHA Mental Health & Addictions
MAH Municipal Affairs & Housing
BCPC Pension Corporation
PSA Public Safety & Solicitor General & Emergency B.C.
SDPR Social Development & Poverty Reduction
TCA Tourism, Arts & Culture
TRAN Transportation & Infrastructure

NOTE See an error or omission? Please create an issue here to get it remedied.

Deploy NRCED/NRPTI Prod Change

Describe the task
We want a ticket to encapsulate the effort required for our first deployment to production for this repository.

Acceptance Criteria

  • NRPTI-949 deployed to production
  • We have an understanding of how to deploy code to NRCED/NRPTI

Additional context

  • We will have one of these tickets for each repository

Meet with SO and Tier 2 - Change Order - NRPTI

Describe the task
Meet with NRPTI and Tier 2 folks to discuss the issue.

Purpose
To ask questions and gain a better understanding of all the moving parts.

Acceptance Criteria

  • To understand what is needed to change the record order, test and complete the task (#995)

Additional context

  • Booked half hour meeting for Jack, Matt B, Jake, Julian and Norris on Oct 26

Get GWELLS Running Locally

Additional context
This is a ticket that will have to be done by every dev so maybe keeping it open until our core team has joined on and completed it may be a good idea.

Definition of Done

  • Get front end of GWELLS running (test it)
  • Get back end of GWELLS running (test it)

NRCED SSL Cert renewal

Describe the task
The NRCED SSL Cert needs to be renewed before March 22nd which is when it is set to expire, if possible we want to automate renewals for NRCED

Purpose
To prevent the service from having a security warning upon landing at the NRCED page

Acceptance Criteria

  • NRCED SSL is renewed
  • NRCED SSL Renewal is automated with Certbot

Additional context

Migrate from Javascript to Typescript for NRPTI API

Describe the task
Moving from javascript to typescript would strongly improve the developers experience in working on the app, and would make it easier for new devs to understand how the API works.

Purpose
Improve maintainability and developer experience, addresses vulnerabilities in NRPTI API, adds consistency, reduces likelihood of introducing new bugs

Acceptance Criteria

  • reformatting javascript files to type script files
  • breakdown files into a better structure (smaller files easier to find what your looking for)

Additional context

  • Add any other context about the task here.
  • Or here

Research effort required to change the formatting and entry requirements of CSVs

Describe the task
Research to see how easy it would be to change the formatting and entry requirements of CSVs.

Acceptance Criteria

  • to have researched and provide information on effort estimation
  • third

Additional context
Need sample inputs (working and non-working CSV files)
Ask if there's a sample of the new format
There is inconsistency in how it uploads

  • From Jack - Sep 20/22
    The main question is if it would require development (i.e., extra money) or if it would be a straight forward fix.

Deploy text change to NRPTI

Describe the task
A clear and concise description of what the task is.

Acceptance Criteria

  • Use existing pipeline to deploy text change to NRPTI Prod
  • ensure appropriate level of documentation for NRPTI Pipeline exists
  • third

Additional context

  • Add any other context about the task here.
  • Or here

NRPTI - Change Chronological Order of Records Being Uploaded from NRIS-EPD

Describe the Bug
Automatic uploads from the NRIS-EPD have been failing and only a portion of the records are uploaded. This happens when NRIS times out.

Expected Behaviour
All the records are re-uploaded every day (~6500 records). Business is requesting that the order in which the NRIS records are uploaded be changed from "oldest to most recent" to "most recent to oldest", if possible. That way, if NRIS times out, then they will have the most recent (and politically sensitive) records.

Actual Behaviour
The upload fails when NRIS times out, resulting in only ~5000 out of the 6500 records being uploaded.

Implications
The last ~1500 records are the most recent uploads -- and also the most politically sensitive ones.

Action
Reverse the order of the records being pulled.

Additional Context

  • Jack will be testing this once order is changed
  • Team should be able to change the order of upload on our side (to reverse order of API calls)
  • Team's ability or involvement to make this change will depend on outcome of Matt B's actions in ticket SD-49498

** Steps To Reproduce**
Steps to reproduce the behaviour:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Solution to provide Angular app deployment flexibility

Routing information is being placed in at develop time in the Angular api service files. This makes deployment involve app code changes. Here are the hardcoded values:

case 'nrpti-dev.pathfinder.gov.bc.ca':

Background

This has been a challenge to address up to now in API backed Angular front-ends (architecture diagram) that are built using the s2i built approach (build diagram), which creates a high performance web server image but at the cost of extra build complexity.

Solution

Here is a simple pattern from Eagle EPIC that solves this in a few lines, meeting the https://12factor.net Factor III, "Store config in the environment" and allowing the app to be deployed based on settings alone. It handles the more complicated s2i builds (other projects that expose environment settings in a similar pattern like MDS use a much simpler build process).

Please see the following areas of code:

  1. Here's where the Angular app consumes the settings from the server and replaces the hardcoded routes
  2. Make sure this line gets placed in the HTML head as it needs to run prior to app load
  3. Create the landing point for the environment variables at server build time
  4. When the pod starts up, and on every subsequent redeployment, set the variables. Javascript was chosen over JSON as it's a direct plugin for the existing variables in api.ts without having to do overhead to handle the JSON. MDS uses JSON.
  5. Pass the environment variables along
  6. Settings exposed in OpenShift

You can check if your settings are exposed by (if you used the same pattern as above) visiting https://your-front-end-url/publicServerEnvironmentSettings.js

And remember to set your app to redeploy on environment variable change. That way your app will get new environment settings without needing a build.

Cheers!

PS. If you have a discrete admin site, the above solution uses the same pattern with slight variations on the path (/admin in the server build and image startup script but html stays the same). Note the use of uniquely named client-side variables to avoid collisions (public vs admin).

Enable NRIS-EMLI importer

As a Service Owner I want to enable scheduled importing of data from NRIS-EMLI So That I can view that data in NRCED, NRPTI, and BCMI.

Additional Context

  • NRIS-EMLI is an external database/API. NRPTI will pull data from here via a cronjob.
  • This functionality has already been implemented by the previous team (see PR #842 / NRPT-707 in BCMI Jira), but wasn't enabled as NRIS-EMLI wasn't ready yet.
  • In #981, research was done and tweaks were made to prepare for this enabling.
  • Now, all that needs to be done to enable the importer, is to toggle 2 environment variables from false to true (see PR #985 for more info).
  • this is working in Test-NRCED, however we need to confirm it is updating on the Test-BCMI side (check with Jack)
    the uploader between the test NRIS-EMLI and the test-BCMI is not active. Is it possible to turn that on so we can see if the records are displaying properly before going into production?
  • if EMLI side isnt publishing it could have to do with "Collections" ask Service Owner

Acceptance Criteria

  • Given that NRIS-EMLI is ready, when the EMLI importer cronjob runs, data from NRIS-EMLI should be visible in NRCED, NRPTI, and BCMI.

Update Keycloak Version - WALLY

Describe the task
The keycloak for wally is currently running at "^6.0.1" which is wildly outdated as the current version is 20.0.0. This should be updated before the realm is moved to gold to assure there are no errors caused by outdated commands/fields.

Acceptance Criteria

  • Change package.json to "^20.0.0"
  • Install updated package.json
  • Test locally to check for authentication errors
  • Record bugs and create a new ticket to address them

Additional context

  • The module to update in package.json is called keycloak-js

Switch Wally to use Gold Realm

In order to migrate to Keycloak gold, WALLY has to be updated to no longer use the deprecated gatekeeper client. Our authentication has to be done on our own backend and we should be requesting tokens from the SSO team's api not a custom proxy that we spun up. So in acceptance criteria are steps to track what has been done to make that happen on the current PR.

Purpose
The Keycloak ID isn't available in Gold, which is why we need to switch to using the GUID (which is available in Gold).

Acceptance Criteria:

  • WALLY logic for configuring gatekeeper is removed (frontend/AuthService.js)
  • AuthService.js is configured to connect to the SSO api instead of gatekeeper
  • main.js initializes the new Keycloak client to check authentication
  • The frontend now correctly handles the new token to display username in the header
  • Meet with Julian to do knowledge transfer
  • Configure HTTP requests so Keycloak token can be sent to the backend
  • BackendAuth class (backend/auth/backend.py) is re-coded to correctly check for new token's roles
  • WALLY gatekeeper deployment is removed
  • Env files are updated to contain the new connection details for Keycloak (copy from frontend/.env.development)

Additional Context:
I have left extra logging and commented out old logic for reference/debugging that should be removed when this ticket is closed.

Currently WALLY assumes that it is getting its authentication done by a proxy and then being returned info it needs in the headers of the HTTP request. That can no longer be the logic in order to move to the gold realm.

The app on my branch is no longer connected to the proxy. It is now connecting directly to the dev environment of the keycloak gold realm. The frontend is working as intended, getting the returned token and displaying the correct name at the top of the page. However the backend has no way of seeing the token anymore and is not designed to do its own authentication.

So for next steps there should be a way to configure HTTP requests to include the token in the header for the backend to be able to handle it accordingly. Next is to read the documentation on Starlette's authentication middleware and configure our AuthBackend in backend/auth/backend.py to handle the new token accordingly instead of assuming authentication is done automatically. Once that is done; the app should be good to go when it comes to the gold realm; before deploying though it is imperative to make sure the database (part of the next ticket) can handle the new token structure. So the definition of done on this ticket is for authentication to be working locally.

  • The Keycloak gold realm is here and it already contains the wally-view role in dev which is what should be checked for authenticating users to see the app.
  • Removing the gatekeeper is simply deleting the files for it's deployment, I haven't done that in case there is info on there that is useful during the backend authentication handling.

Set Up NRPTI

Describe the task
Developers have NRPTI set up locally.

Acceptance Criteria

  • Set up front end
  • Set up back end
  • Test digital service (aka app) locally

Additional context
N/A

NRCED Monitoring Review

Describe the task
Review Repo, understand what type of monitoring exists for the app, what it would take to set it up, and what is missing.

Acceptance Criteria

  • first
  • second
  • third

Additional context

  • What tools already exist for monitoring? (e.g. Uptime and others?) Developers will look into this further.

Auto-populate Regulations Field

As a (User Type/Persona) I want to be able to have the description field auto-populate when I type in Fish and Seafood Licensing Regulation So That I don't have to remember all the legislation

Additional Context

  • Functionality exists. This specific use case doesn't.
  • Jake to confirm this is NRPTI (not NRCED).
  • Program a new auto-populated Description field for a new Legislation: when a new entry is put in NRPTI, they have the option to have a legislation added like this (picture below)|
  • If the legislation is already “pre-coded” then the description field will be auto-populated. But if the legislation is new to NRPTI, then we need to add the new description. The new legislation is "Fish and Seafood Licensing Regulation, section 21(1)(a)". The offence should read: "Operate as fish receiver without licence."
  • Leave Act and Paragraph off the ticket

image.png

Acceptance Criteria

  • Given (Context), When (action carried out), Then (expected outcome)
  • Given (Context), When (action carried out), Then (expected outcome)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.