Git Product home page Git Product logo

nr-forest-client-api's Introduction

Contributors Forks Stargazers Issues MIT License Lifecycle

The nr-forest-client-api application provides the API that allows systems to consume forest client data without having to connect to a database. We are working the process to publish our API

The nr-forest-client-api is a Java application, integrated with the greenfield-template to automate the process for testing, security scanning, code quality checking, image building and deploying. It is hosted in openshift, protected and published through API Services Portal

Configuring IntelliJ Code Style

You will find a copy of the google code style inside our docs folder.

On the settings screen, add the checks as the following image:

intellij code style

Configuring IntelliJ Run Configuration

To set your profile on IntelliJ, just run the application main class and edit the configuration as the following image.

intellij run configuration

Configuring Eclipse Code Style

You will find a copy of the google code style inside our docs folder.

On the window > preferences screen, go to Java > Code Style > Formatter, import the xml file and keep GoogleStyle selected as the following image:

eclipse code style

Configuring Eclipse Run Configuration

To set your profile on Eclipse, just run the application main class and edit the configuration as the following images.

eclipse run configuration main

eclipse run configuration params

Setting up Lombok on Eclipse

If you're running eclipse, you will need to manually install lombok in order for it to work. The easiest way of doing that is by running any mavem command that would trigger the download of the lib, such as mvn clean compile.

Once it's done, navigate to your repository folder (its usually inside your user folder, called .m2/repository) and look the latest version of lombok (inside org/projectlombok/lombok/) and run the lombok jar, like java -jar lombok-X.Y.Z.jar.

eclipse lombok install

A screen will pop up, listing all the possible IDEs, select yours and install/update it. Once it's done, restart eclipse.

nr-forest-client-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nr-forest-client-api's Issues

ZAP: API

View the following link to download the report.
RunnerID:7719780939

PenTest should not block deployment

Describe the Bug
PenTest runs after each deployment and blocks a deployment

Expected Behaviour
Pentests should run periodically instead of during deployments and should not block deployments

Actual Behaviour
Zap (PenTest) is blocking deployments with warnings

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

  1. Do a deployment

Screenshots
Screen Shot 2024-01-25 at 12 55 25 PM

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

This issue is a kind reminder that your repository has been inactive for 181 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!

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 it's 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 it, 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
IRR 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 Service Agency
PSSG Public Safety and Solicitor General
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.

Fetch the locations associated to a client

As an API client I want to fetch information about CLIENT_LOCATION given a FOREST_CLIENT's client number or its acronym So That part of this information can be displayed for the final user.

Additional Context

  • Client and location information will be mostly displayed together in our application.
  • Either creating a specific endpoint for this (e.g. /clientLocations?clientNumber=&acronym=, /client/{clientNumber}/locations) or just returning the location information in the existing client endpoint (/clients) would work for us.

Acceptance Criteria

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

Definition of Done

  • Ready to Demo in Sprint Review
  • Does what I have made have appropriate test coverage?
  • Documentation and/or scientific documentation exists and can be found
  • Peer Reviewed by 2 people on the team
  • Manual testing of all PRs in Dev and Prod
  • Merged

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 for a general search api

Describe the task

  • We want a general search api, which will allow us to provide either a name (client name) or a forest client number, and the api will return all the possible results based on a wildcard search
  • In the return data, we want to get description for the client type code and client status code
  • If the user not found, return status code 2xx not 404

For example:
In an input box, we type “CanFor”, we can get all the forest client that has client name includes “CanFor”
And if we type “1234”, we can get all the forest client that has client number includes “1234”

Acceptance Criteria

  • A new api that allows us search by either client name or client number, and get a list of possible client with partial match
  • The return client information has whatever the findbyclientnumber api returns, plus a description for the client type code, and a description for the client status code
  • If can't find the user, return status code 2xx not 404

Log in with different cases for IDIR creates multiple user records

Describe the Bug
If I log in twice in IDIR, once using BVANDEGR and once using lower-case bvandegr, then two user records get created by lambda_function.py (because the check for existing user is based on case-sensitive username).

Access is only granted to BVANDEGR so this is bad.

Expected Behaviour
A clear and concise description of what you expected to happen.

Actual Behaviour
A clear and concise description of what you expected to happen.

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

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

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

FSADT1-420: Update existing forest client api to use java

FSADT1-420 Update existing forest client api to use java

  • Maria copy findbynumber and findallnonindividuals over to Maria’s branch
  • Maria continue with apis:
    • add findallnonindividuals request
    • add find by name, filter by client type
    • create a basic test
    • add more core config
    • redirect base url to swagger page
  • Catherine:
    • create oracle connection locally and basic api
    • create docker file
    • enable basic pipeline
    • check how to make oracle connection in openshift
    • enable swagger
    • check Postgres connection
    • update openshift API Gateway to the new api

Tutorial:
nr-arch-templates for remote oracle connection through openshift for java app
spring boot simple start
spring boot oracle db example

Support oracle connection in openshift:

  • InstallCert.java file is used to auto grab certificate (we can just use it, no need to modify anything)
  • startup.sh run the command to setup certificate automatically and then start the app

Fetch the locations associated to a client

As an API client I want to fetch information about CLIENT_LOCATION given a FOREST_CLIENT's client number or its acronym So That part of this information can be displayed for the final user.

Additional Context

  • Client and location information will be mostly displayed together in our application.
  • Either creating a specific endpoint for this (e.g. /clientLocations?clientNumber=&acronym=, /client/{clientNumber}/locations) or just returning the location information in the existing client endpoint (/clients) would work for us.

Acceptance Criteria

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

Definition of Done

  • Ready to Demo in Sprint Review
  • Does what I have made have appropriate test coverage?
  • Documentation and/or scientific documentation exists and can be found
  • Peer Reviewed by 2 people on the team
  • Manual testing of all PRs in Dev and Prod
  • Merged

Allow fetching a forest client by its acronym

Describe the task
Create an endpoint (or modify an existing one) to allow us to fetch a forest client by its acronym.

Acceptance Criteria

  • Given an acronym, an API client can fetch a single forest client using the API.

Additional context

  • The acronym is meant to be a second identifier for the forest client: it can be used in place of the client number to identify and fetch a single client.
  • SPAR already uses this feature, and will continue to use it in the new version.

Dependency Dashboard - old

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • fix(deps): update dependency org.springframework.boot:spring-boot-starter-parent to v3.1.5

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): update docker/login-action digest to b4bedf8
  • chore(deps): update all non-major dependencies (bcgov-nr/action-builder-ghcr, bcgov-nr/action-deployer-openshift, bcgov-nr/action-test-and-analyse-java, madrapps/jacoco-report, maven, org.apache.maven.plugins:maven-javadoc-plugin, org.jacoco:jacoco-maven-plugin, org.apache.maven.plugins:maven-surefire-plugin, org.apache.maven.plugins:maven-failsafe-plugin, org.yaml:snakeyaml)
  • chore(deps): update github actions all dependencies (major) (TriPSs/conventional-changelog-action, actions/checkout, bcgov-nr/action-deployer-openshift, bcgov-nr/action-pr-description-add, bcgov-nr/action-test-and-analyse-java, mikepenz/action-junit-report)

Detected dependencies

dockerfile
Dockerfile
github-actions
.github/workflows/api-check.yml
  • actions/checkout v3
  • ubuntu 22.04
.github/workflows/merge-main.yml
  • actions/checkout v3
  • github/codeql-action v2
  • actions/setup-java v3
  • github/codeql-action v2
  • bcgov-nr/action-test-and-analyse-java v0.1.0
  • actions/checkout v3
  • aquasecurity/trivy-action 0.12.0
  • github/codeql-action v2
  • actions/checkout v3
  • bcgov-nr/action-deployer-openshift v1.0.2
  • bcgov-nr/action-gwa-publish v0.1.0
  • TriPSs/conventional-changelog-action v3
  • softprops/action-gh-release v1
  • docker/login-action f4ef78c080cd8ba55a85445d5b36e214a81df20a
  • shrink/actions-docker-registry-tag v3
  • actions/checkout v3
  • bcgov-nr/action-deployer-openshift v1.0.2
  • bcgov-nr/action-gwa-publish v0.1.0
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/pr-close.yml
  • actions/checkout v3
  • shrink/actions-docker-registry-tag v3
  • mshick/add-pr-comment v2
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/pr-open.yml
  • actions/checkout v3
  • actions/labeler v4
  • bcoe/conventional-release-labels v1
  • actions/checkout v3
  • TriPSs/conventional-changelog-action v3
  • actions/checkout v3
  • thollander/actions-comment-pull-request v2
  • bcgov-nr/action-pr-description-add v0.0.2
  • actions/checkout v3
  • bcgov-nr/action-builder-ghcr v1.2.0
  • actions/checkout v3
  • actions/setup-java v3
  • actions/checkout v3
  • bcgov-nr/action-deployer-openshift v1.0.2
  • actions/checkout v3
  • mikepenz/action-junit-report v3
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/unit-tests.yml
  • bcgov-nr/action-test-and-analyse-java v0.1.0
  • actions/upload-artifact v3
  • mikepenz/action-junit-report v3
  • madrapps/jacoco-report v1.3
  • actions/checkout v3
  • aquasecurity/trivy-action 0.12.0
  • github/codeql-action v2
  • ubuntu 22.04
  • ubuntu 22.04
maven
pom.xml
  • org.springframework.boot:spring-boot-starter-parent 3.1.4
  • org.springdoc:springdoc-openapi-starter-webflux-ui 2.2.0
  • org.apache.commons:commons-lang3 3.13.0
  • org.testcontainers:testcontainers-bom 1.19.1
  • org.yaml:snakeyaml 2.1
  • org.apache.maven.plugins:maven-failsafe-plugin 3.1.2
  • org.apache.maven.plugins:maven-surefire-plugin 3.1.2
  • org.jacoco:jacoco-maven-plugin 0.8.10
  • org.apache.maven.plugins:maven-javadoc-plugin 3.5.0
  • org.apache.maven.plugins:maven-checkstyle-plugin 3.3.0
  • org.cyclonedx:cyclonedx-maven-plugin 2.7.9
maven-wrapper
.mvn/wrapper/maven-wrapper.properties
  • maven 3.9.4
  • maven-wrapper 3.2.0

Get proxy account for FOREST_CLIENT table

Need to talk to the data custodian. Chantelle knows who they are.

https://apps.nrs.gov.bc.ca/int/confluence/display/AR/Data+Integration

There are a fair number of pre-requisites and process around data integration. This confluence doc is a good checklist, but I'll copy the checklist over here as well so we can track progress.

  • Has the Team identified the data\information required for the business needs?
  • Has the Team documented the business needs as related to the data sought. https://github.com/bcgov/forest-client-api/wiki/Business-Requirements#fom
  • Has the Team identified the source of the data\information - this includes the object\table\schema sources and database instances?
  • Has the Team identified the security classifications of the data\information identified**. Has the Data Custodian been identified, is it clear how the data can be shared, and to whom? (ie. is it open, public, government only, named user?)
  • Has the Team documented the source location, name and security classification of the data sought? (If so provide source/link/documents)
  • Has the Team discussed with the Data Custodian(s) the reason and approach for accessing their data and have approval to proceed?
  • Has the Team documented the Data Custodian approval (If so provide source/link/documents)
  • Has the Team discussed with the Privacy and Security Teams to assess the level of documentation, re-assessment of PIA/STRA/SOARs required and have approval to proceed?
  • Has the Team documented the Privacy and Security approvals (If so provide source/link/documents)
  • Has the Team discussed the architectural approach with IIT Architects to ensure strategic direction and alignment. This includes such details as proposed approach, such as proxy account creation in Oracle, role grants required, (CRUD) level of access, technology stack to be used, extract-transform-load requirements, sources and destination routes.
  • Has the Team documented the approach for accessing the data (If so provide source/link/documents). (This service could be provided by IIT Architects)
  • Has the Team prepared scripts for the Database proxy account creation (requested by the DBA team via AEA/MAS/BPM? team via a Jira Ticket in the Team's Jira Project team space as an RFC/RFD?)
  • Has the Team requested the implementation via the appropriate/communicated channels? (see above item that needs more clarity)
  • Has the requested IIT Team actioned and completed the request?
  • Has the Team documented the actions?
  • Other items may be necessary if access is via alternate routes such as a WebADE/WSO2 service client access??
  • Implement the data integration
  • Documentation: IRS updated
  • Documentation: Architecture's Confluence Space
  • Documentation: Confluence Project Space with links to Jira
  • Documentation: Database/Schema documentation spaces?

Lets use common phrasing

TL;DR 🏎️

Teams are encouraged to favour modern inclusive phrasing both in their communication as well as in any source checked into their repositories. You'll find a table at the end of this text with preferred phrasing to socialize with your team.

Words Matter

We're aligning our development community to favour inclusive phrasing for common technical expressions. There is a table below that outlines the phrases that are being retired along with the preferred alternatives.

During your team scrum, technical meetings, documentation, the code you write, etc. use the inclusive phrasing from the table below. That's it - it really is that easy.

For the curious mind, the Public Service Agency (PSA) has published a guide describing how Words Matter in our daily communication. Its an insightful read and a good reminder to be curious and open minded.

What about the master branch?

The word "master" is not inherently bad or non-inclusive. For example people get a masters degree; become a master of their craft; or master a skill. It's generally when the word "master" is used along side the word "slave" that it becomes non-inclusive.

Some teams choose to use the word main for the default branch of a repo as opposed to the more commonly used master branch. While it's not required or recommended, your team is empowered to do what works for them. If you do rename the master branch consider using main so that we have consistency among the repos within our organization.

Preferred Phrasing

Non-Inclusive Inclusive
Whitelist => Allowlist
Blacklist => Denylist
Master / Slave => Leader / Follower; Primary / Standby; etc
Grandfathered => Legacy status
Sanity check => Quick check; Confidence check; etc
Dummy value => Placeholder value; Sample value; etc

Pro Tip 🤓

This list is not comprehensive. If you're aware of other outdated nomenclature please create an issue (PR preferred) with your suggestion.

FSADT1-316: Investigate FME for data migration

FSADT1-316 Investigate FME for querying large data

For FME api that could allow setup cron job in openshift, some reading link:
https://apps.nrs.gov.bc.ca/int/jira/browse/INFRA-13455
https://apps.nrs.gov.bc.ca/int/confluence/display/AR/2021-02-12+NRPTI+data+flow+options
https://apps.nrs.gov.bc.ca/int/confluence/pages/viewpage.action?pageId=91193899
https://apps.nrs.gov.bc.ca/int/confluence/pages/viewpage.action?pageId=91199846

Advantage:

  • Copy data really fast
  • Support complicate data transform (renaming, combine columns)

Restriction:

  • The process of getting FME Server and API is unknown, not sure how to handle data merge and table updates
  • Take time to learn and hard finding examples

Alternative Solution:

  • Run db script to create the table with relationships
  • Use FME Desktop for one-time data transfer with option "Create if needed" and "insert"
  • Write a function in nestjs application to check and do db updates every night

Steps to copy the Forest_Client table from oracle db to postgres db in openshift:

  1. Get FME Desktop
  • Download citrix workspace app https://www.citrix.com/downloads/workspace-app/
  • Go to dts.gov.bc.ca -> login with idir -> find the desktop “Kamloops Desktop - ArcGIS 10-8 Test” -> click on it to start Citrix desktop
  • Click okay for the pop up window for security and permission
  • From the start menu, search for FME Desktop -> FME work bench
  1. Inside FME, could create readers and writers which read from original database and write into new database
  2. Add reader: select readers from top menu bar -> add reader -> format select oracle non-spatial -> and add database connection, enter credentials -> add parameter, select the table name -> click "Ok"

Screen Shot 2022-09-27 at 4 55 00 PM

Screen Shot 2022-09-27 at 4 57 26 PM

4. Once the reader is added, could click the front triangle to expand and see the table columns

Screen Shot 2022-09-27 at 4 58 16 PM

5. Add writer: select writers from top menu bar -> add writer -> format select postgressql -> and add database connection, enter credentials -> table definition select "automatic" -> click "Ok". The following screenshot is an example connect to a database in openshift that got port forward to 4200 on localhost.

Screen Shot 2022-09-29 at 2 53 58 PM

6. After click ok to add the writer, it will pop up a feature type window, where we could define the table name in the postgres db, and the operation and table handling, change the table name to whatever you like and click ok. This also allows you to select if you want the writer to insert or update or delete data, and how to handle the case when has an existing table, like "Drop and Create" or "Create if needed"

Screen Shot 2022-09-29 at 2 56 31 PM

7. If just want a direct data copy without any restructure, could just go to "View" in the top menu bar -> select "Windows" -> select "Feature Type Connection". This will open a session at the bottom, where we could click on to select the table name under "source" and select the table name under "destination", and then click "connect". This will link the table attributes from the source db table to the new db table

Screen Shot 2022-09-29 at 3 04 53 PM

8. If we want to rename the column in the new table in postgres db, or add more column, click on the setting icon next to the writer

Screen Shot 2022-09-29 at 3 12 19 PM

This will open the feature type settings. Let's select "User Attributes" tab and "Manual" for attribute definition. This will allow us to rename the column, re-describe the column, and add or delete columns, and order the columns. There is a list of icon at the bottom for adding/deleting/reordering columns

Screen Shot 2022-09-29 at 3 14 00 PM

9. If want to combine two columns in the oracle table and put into a new column in the postgres table, could add a transformer "String Concatenator", press enter

Screen Shot 2022-09-29 at 3 29 31 PM

10. A transformer is added for combine column values. Update the feature type connection, to let oracle source table connect to the input of the string concatenator, and let output of the string concatenator connect to the postgres destination table

Screen Shot 2022-09-29 at 3 30 42 PM

11. Click on the setting icon for the string concatenator, give a name for the new attribute, and select the string type as "Attribute Value" and select the column name from dropdown for "String Value". So we add a new column called "incorporation_number" here, and its value is the combine of two columns, "REGISTRY_COMPANY_TYPE_CODE + CORP_REGN_NMBR "

Screen Shot 2022-09-29 at 3 34 21 PM

12. Click on the setting icon for the writer, add an extra column for "incorporation_number" as well, and then click on the triangle from "incorporation_number" under the string concatenator to link to the "incorporation_number" under the writer, so it's mapped 13. To add a primary key, click on the setting icon for the writer, "user attribute" tab, could add a column with type serial, and then select "primary key" under "index"

Screen Shot 2022-09-29 at 3 40 31 PM

14. The final flow chart looks like this

Screen Shot 2022-09-29 at 3 42 05 PM

15. To connect to the remote openshift postgres db, download the openshift cli tools from namespace, and use that to do a port forwarding, so our above Postgres config works. From the command line `oc project [namespace]` and `oc port-forward [postgres-db-pod] 4200:5432 ` 16. Click the Run button in the FME to run the workspace

Reference reading:
Importing Database Tables, Raster Data, Vector Data
Managing Feature Type Connections
To update and manage database connections

Add acronym information

Describe the task
Add the client's acronym to the forest client JSON.

The forest client acronym is located in the forest client table (FOREST_CLIENT.CLIENT_ACRONYM) and the CLIENT_ACRONYM.CLIENT_ACRONYM view.

Acceptance Criteria

  • Include the acronym information in all returns of the present endpoints under /client

Additional context

  • Our project will display the client's acronym in most cases where the client's name is displayed.

Go through AWS onboarding

The team decided that API development (or at least some component of it) may happen on AWS, so we are onboarding over there. There is a high likelihood that we will synchronize the forest client data to RDS and then put an API interface on top of RDS so that we don't have to link directly to Oracle.

FSADT1-389: Explore data migration tools ora2pg

FSADT1-389 Explore data migration tools ora2pg

Documentation for ora2pg is here: https://ora2pg.darold.net/documentation.html#Ora2Pg-usage, an example, it can export a specific table to a target postgres db

Advantage:

  • Same pattern could be used for all tables need to be exported
  • Speed is okay (takes about 15 mins to export the forest_client table)

Restriction:

  • Doesn't support handle complicate structure, for example combine two columns into one
  • Doesn't support data merge, it will overwrite the existing table
  • Installation doc is not easy to follow
  • Need some manual steps when import the data to choose which to import

Installation through docker:

# RedHat UBI 8
FROM registry.access.redhat.com/ubi8/ubi

# Install required packages for oracle client
RUN dnf install -y wget unzip libaio yum perl make gcc libpq-devel

RUN mkdir -p /opt/oracle/tool && \
    cd /opt/oracle/tool && \
    wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-sqlplus-linux.x64-21.7.0.0.0dbru.zip && \
    unzip instantclient-sqlplus-linux.x64-21.7.0.0.0dbru.zip && rm -f instantclient-sqlplus-linux.x64-21.7.0.0.0dbru.zip && \
    cd /opt/oracle/tool && \
    wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-basic-linux.x64-21.7.0.0.0dbru.zip&& \
    unzip instantclient-basic-linux.x64-21.7.0.0.0dbru.zip && rm -f instantclient-basic-linux.x64-21.7.0.0.0dbru.zip && \
    cd /opt/oracle/tool && \
    wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-sdk-linux.x64-21.7.0.0.0dbru.zip && \
    unzip instantclient-sdk-linux.x64-21.7.0.0.0dbru.zip && rm -f instantclient-sdk-linux.x64-21.7.0.0.0dbru.zip

WORKDIR /tool
COPY . ./
RUN wget https://github.com/darold/ora2pg/archive/v23.1.zip && \
    unzip v23.1.zip && \
    cd ora2pg-23.1 && \
    perl Makefile.PL && \
    make && make install

# install postgres
RUN yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
RUN yum install -y postgresql12-libs.x86_64 postgresql12.x86_64

# postgres 10 is installed by libpq-devel and works with DBD:Pg 
ENV POSTGRES_HOME /usr/pgsql-10
ENV ORACLE_HOME /opt/oracle/tool/instantclient_21_7
ENV LD_LIBRARY_PATH /opt/oracle/tool/instantclient_21_7

RUN perl -MCPAN -e 'install DBI' && \
    perl -MCPAN -e 'install Test::NoWarnings' && \
    perl -MCPAN -e 'install DBD::Oracle' && \
    echo y | perl -MCPAN -e 'install DBD::Pg'

Data migration steps for local postgres:

  1. Add the above docker file steps into the docker file in the backend folder, add oracle db credentials as env variables if need. Build and start the docker container, go the docker container cli
  2. Initial a migration project ora2pg --project_base $HOME --init_project migration_project
  3. Update configuration options at ~/migration_project/config/ora2pg.conf
ORACLE_DSN      dbi:Oracle:host=[oracle_hostname];service_name=[oracle_servicename];port=[port, for example 1521]
ORACLE_USER     [oracle_username]
ORACLE_PWD      [oracle_password]
SCHEMA  the  # the specific schema want to export

PG_DSN          dbi:Pg:dbname=[postgres_dbname];host=[postgres_hostname];port=[port, for example 5432]
PG_USER         [postgres_username]
PG_PWD          [postgres_password]

ALLOW           FOREST_CLIENT  # the specific table want to export

# optional
MODIFY_STRUCT   FOREST_CLIENT(client_number, client_name, registry_company_type_code, corp_regn_nmbr, legal_first_name, legal_last_name, client_status_code, client_type_code, birthdate, client_comment, add_timestamp, update_timestamp, add_userid, update_userid) # an example what is want from this table

REPLACE_TABLES  FOREST_CLIENT:CLIENT # rename forest_client table to be called client in postgres

REPLACE_COLS    FOREST_CLIENT(legal_first_name:first_name,legal_last_name:last_name,client_name:organization_name) # rename some column in this table, in the format of TABLE_NAME[origin_column_name:new_column_name]
  1. Check connections ora2pg -t SHOW_VERSION -c $HOME/migration_project/config/ora2pg.conf, if the connection is successful, it should return the source Oracle database version
  2. Setup postgres env variables and create a file $HOME/.pgpass, and put [PG_IP_ADDRESS]:5432:[DB_NAME]:[PG_USERNAME]:[PG_PWD] in it, to prevent psql from repeatedly prompting for a password during import operations. Restrict the read and write permissions for the password file chmod 600 $HOME/.pgpass
export PGDATABASE=[DB_NAME]
export PGUSER=[PG_USERNAME]
export PGHOST=[PG_IP_ADDRESS]
export PGPORT=5432
  1. Export schema $HOME/migration_project/export_schema.sh
  2. Import schema $HOME/migration_project/import_all.sh -d $PGDATABASE -o $PGUSER -h $PGHOST -U $PGUSER -I -s, make sure to answer "N" for the first question about if want to drop the existing database. And "y" for import table, and "N" for synonym (synonym is something postgres not support, so it will try to create a view instead, we don't need that at this moment)
  3. Run data migration ora2pg -t COPY -o data.sql -b $HOME/migration_project/data -c $HOME/migration_project/config/ora2pg.conf

Data migration for remote postgres in openshift:

  1. Steps are similar as above, just need some additional settings to make the remote connection
  2. Run port forwarding for openshift postgres db deployment config
# login to the namespace 
oc project [namespace]
# port forward the pod
oc port-forward [postgres-db-pod] 4200:5432
  1. Update the configuration file ~/migration_project/config/ora2pg.conf for postgres credential, and env variables, and $HOME/.pgpass file to use the new credential. Host need to be docker.for.mac.host.internal (for Mac) or host.docker.internal to let it point to the host localhost, instead of the container localhost
PG_DSN          dbi:Pg:dbname=[postgres_dbname];host=docker.for.mac.host.internal;port=4200

Test / Prod Parity for users / Authorizations

When adding new users to the FOM application they should be added to TEST and PROD so that when the access test they are working with the same roles that they would when logged into test.

Currently the way that users in TEST are configured is they all get access to the same 1011 / 1012 roles.

One detail around implementation is we do not want to remove the existing 1011/1012 roles until Julius has a chance to message back to potential test users.

Blank browser screen on initial app launch in new browser

Describe the Bug
When I launch the app by opening a new browser (e.g. after clearing history) and type in URL, I get a blank page. The web console shows the following error:
Uncaught TypeError: Cannot read properties of null (reading 'fam_cognito_region')

Expected Behaviour
The application screen displays properly. This does happen when I refresh the page.

Actual Behaviour
Blank screen is displayed. In the code, it appears it is initializing main.ts and specifically awsExports before env.js is called to initialize the environment. Perhaps move initializing of env.js into main.ts???

Additional context
Observed in Edge and Chrome.

Evaluate generated golang

Checking out what kind of code comes out of the golang swagger generator. Using it to create a stub for the forest_client_api

Use Dockerfile to build GraalVM

For consistency and simplicity use a Dockerfile to build GraalVM images. There's also apparently an issue with the GraalVM action, stopping the PR Open workflow.

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!

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • fix(deps): update maven all non-major dependencies (org.springframework:spring-web, io.netty:netty-codec-http, org.springframework.boot:spring-boot-starter-parent)
  • chore(deps): update aquasecurity/trivy-action action to v0.21.0

Detected dependencies

dockerfile
Dockerfile
github-actions
.github/workflows/api-check.yml
  • actions/checkout v4
  • ubuntu 22.04
.github/workflows/merge.yml
  • actions/checkout v4
  • bcgov-nr/action-deployer-openshift v2.3.0
  • bcgov-nr/action-gwa-publish v0.1.0
  • TriPSs/conventional-changelog-action v5
  • softprops/action-gh-release v2
  • shrink/actions-docker-registry-tag v4
  • actions/checkout v4
  • bcgov-nr/action-deployer-openshift v2.3.0
  • bcgov-nr/action-gwa-publish v0.1.0
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/pr-close.yml
  • actions/checkout v4
  • shrink/actions-docker-registry-tag v4
  • mshick/add-pr-comment v2
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/pr-open.yml
  • actions/checkout v4
  • actions/labeler v5
  • bcoe/conventional-release-labels v1
  • TriPSs/conventional-changelog-action v5
  • thollander/actions-comment-pull-request v2
  • bcgov-nr/action-pr-description-add v1.1.1
  • bcgov-nr/action-builder-ghcr v2.0.2
  • bcgov-nr/action-deployer-openshift v2.3.0
  • bcgov-nr/action-deployer-openshift v2.3.0
  • actions/checkout v4
  • mikepenz/action-junit-report v4
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/reusable-tests-be.yml
  • bcgov-nr/action-test-and-analyse-java v1.0.2
  • actions/upload-artifact v4
  • mikepenz/action-junit-report v4
  • madrapps/jacoco-report v1.6
  • ubuntu 22.04
.github/workflows/reusable-tests-repo.yml
  • actions/checkout v4
  • aquasecurity/trivy-action 0.20.0
  • github/codeql-action v3
  • actions/checkout v4
  • github/codeql-action v3
  • actions/setup-java v4
  • github/codeql-action v3
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/scheduled.yml
  • zaproxy/action-full-scan v0.10.0
maven
pom.xml
  • org.springframework.boot:spring-boot-starter-parent 3.2.5
  • org.springdoc:springdoc-openapi-starter-webflux-ui 2.5.0
  • org.apache.commons:commons-lang3 3.14.0
  • org.testcontainers:testcontainers-bom 1.19.8
  • org.springframework:spring-web 6.1.7
  • io.netty:netty-codec-http 4.1.109.Final
  • org.apache.maven.plugins:maven-failsafe-plugin 3.2.5
  • org.apache.maven.plugins:maven-surefire-plugin 3.2.5
  • org.jacoco:jacoco-maven-plugin 0.8.12
  • org.apache.maven.plugins:maven-javadoc-plugin 3.6.3
  • org.apache.maven.plugins:maven-checkstyle-plugin 3.3.1
  • org.cyclonedx:cyclonedx-maven-plugin 2.8.0
maven-wrapper
.mvn/wrapper/maven-wrapper.properties
  • maven 3.9.7

  • Check this box to trigger a request for Renovate to run again on this repository

Fetch the locations associated to a client

As an API client I want to fetch information about CLIENT_LOCATION given a FOREST_CLIENT's client number or its acronym So That part of this information can be displayed for the final user.

Additional Context

  • Client and location information will be mostly displayed together in our application.
  • Either creating a specific endpoint for this (e.g. /clientLocations?clientNumber=&acronym=, /client/{clientNumber}/locations) or just returning the location information in the existing client endpoint (/clients) would work for us.

Acceptance Criteria

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

Definition of Done

  • Ready to Demo in Sprint Review
  • Does what I have made have appropriate test coverage?
  • Documentation and/or scientific documentation exists and can be found
  • Peer Reviewed by 2 people on the team
  • Manual testing of all PRs in Dev and Prod
  • Merged

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.