Coder Social home page Coder Social logo

bcgov / gwells Goto Github PK

View Code? Open in Web Editor NEW
27.0 12.0 35.0 40.34 MB

Groundwater Wells and Aquifers application for the Ministry of Environment

Home Page: https://apps.nrs.gov.bc.ca/gwells/

License: Apache License 2.0

Python 53.97% Shell 2.49% HTML 0.28% CSS 0.02% JavaScript 9.90% Groovy 3.33% Vue 29.47% Makefile 0.05% Dockerfile 0.28% SCSS 0.22%
bcgov-csnr django vuejs groundwater-data env

gwells's Introduction

img

Groundwater Wells and Aquifers (GWELLS)

https://apps.nrs.gov.bc.ca/gwells/

Introduction

The Ministry of Environment receives and processes groundwater data and information related to the construction, alteration and decommissioning of groundwater wells. Well construction and reporting requirements are regulated under the Water Sustainability Act and Groundwater Protection Regulation. The information collected and stored is used by government and other users to help inform decisions related to the management of the groundwater resource in B.C.

GWELLS, the new groundwater data repository, aims to improve the user experience when submitting and searching for well information, to improve the quality of the data being submitted, and to improve the overall functionality of the system to meet user and regulatory requirements.

The application is being developed as an open source solution.

Table of Contents

  1. Using the GWELLS API
  2. DataBC Export
  3. Developing GWELLS
  4. Architecture
  5. Contributing
  6. License

Using the GWELLS API

GWELLS maintains a REST API where public data relating to wells is made available for other applications and services.

Our Swagger documentation is available at https://apps.nrs.gov.bc.ca/gwells/api/. Some examples of GWELLS endpoints:

Wells:

# all wells (paginated)
curl https://apps.nrs.gov.bc.ca/gwells/api/v1/wells

# all wells in an area bounded by sw_lat, sw_long, ne_lat, and ne_long
curl https://apps.nrs.gov.bc.ca/gwells/api/v1/wells?sw_lat=51.599253&sw_long=-128.220340&ne_lat=52.108192&ne_long=-127.150547

Aquifers:

# all aquifers
curl https://apps.nrs.gov.bc.ca/gwells/api/v1/aquifers

See the Swagger documentation for more examples.

DataBC Export

GWELLS Api is used by DataBC to export model information and provide well information on the DataBC website.

The command located in app/backend/gwells/management/commands/export_databc.py is used to pull data from the gwells database and export it for consumption in DataBC.

If a new field(s) are needed for export, this export_databc.py has raw sql queries that need to be updated with the required fields. Descriptions are also needed for the swagger documentation that are pulled from the db_comment fields in the django models. Both the raw sql queries and the db_comment field on the model need to be updated for new fields.

Developing GWELLS

Setup Prerequisites

Software Requirements

  • Docker Desktop
  • Node

Actions to take:

Connecting to Minio

For gwells to interact with your local instance of Min.IO add the appropriate settings to your local machines HOSTS file:

127.0.0.1 minio-public
127.0.0.1 minio-private

Authentication

Some GWELLS pages (submitting new well reports, adding or editing aquifers, or adding or editing qualified well drillers to the registry) require authentication. Authentication uses the Province's Single Sign-On system. A GWELLS team member can request access for collaborators if needed.

Running the GWELLS application locally

Login to Artifactory for pulling the backend base image:

docker login -u <svc-usn> -p <svc-pwd> artifacts.developer.gov.bc.ca/g26e-backend-docker-local

Replace svc-usn and svc-pwd with Artifactory service account credentials obtained from Openshift (under artifacts-default-tulivf secrets)

Then, run the application with Docker:

cd gwells
docker-compose up

Running GWELLS locally with a connection to Staging's Database

To have a more complete dataset while running locally, you can opt to point the backend at GWELLS' staging database while using the BC Government VPN. This will provide a more robust dataset for debugging or feature testing.

  1. Duplicate .env.template and rename the new file as .env.test

  2. Using the database secrets from GWELLS' staging namespace on OpenShift, replace the variables in your new .env.test file. You'll need to change ENVIRONMENT to 'test' as well to ensure the proper command is run from the app/scripts/backend-command-script.sh file.

    Note: to get the GWELLS_SERVICE_HOST and GWELLS_SERVICE_PORT, use the oc CLI and login to GWELLS' test namespace; run the following command to view the TransportServer for the staging database:

    oc project 26e83e-test
    
    oc -n 26e83e-test get ts
    

    This should print out a VIRTUALSERVERADDRESS (the GWELLS_SERVICE_HOST) and a VIRTUALSERVERPORT (the GWELLS_SERVICE_PORT)

    NAME              VIRTUALSERVERADDRESS   VIRTUALSERVERPORT   POOL          POOLPORT   IPAMLABEL   IPAMVSADDRESS   STATUS   AGE
    yourservice-tsc   142.34.194.68          65555               yourservice   8000                   None            Ok       21d
    

    Your .env.test file should look something like this:

    # .env for test environment
    ENVIRONMENT=test
    API_TARGET=http://backend:8000/
    DATABASE_USER=<db-user>
    DATABASE_PASSWORD=<db-password>
    GWELLS_SERVICE_HOST=142.34.194.68
    GWELLS_SERVICE_PORT=<port-number>
    
  3. Once .env.test has the proper environment variables, run the docker-compose up command with the --env-file flag:

    docker-compose --env-file ./.env.test up
    

You should now have a local build with a backend that points to staging's database. Be mindful when saving or changing data to the staging database.

If you're encountering any issues with the build, ensure that your VPN is connected and working properly.

Minio doesn't download while connected using the VPN. This is a known issue.

Running GWELLS in Debug Mode

Ensure you have a launch.json file in the .vscode directory.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Remote Django App",
      "type": "python",
      "request": "attach",
      "pathMappings": [
        {
          "localRoot": "${workspaceFolder}/app/backend",
          "remoteRoot": "/app/backend"
        }
      ],
      "port": 3000,
      "host": "localhost"
    }
  ]
}

In VS Code, press F5 or go to Run > Start Debugging to run in debug mode.

You can now add breakpoints within GWELLS - more information about debugging in VS Code here.

Connecting to PGAdmin

Information in this section reflects docker-compose as of Nov 8th, 2023

PG Admin is setup in the docker-compose up and requires no additional installations

Steps:

  1. Connect to Pgadmin through localhost
  2. Login using username: [email protected], password: admin
  3. Right click Server -> Register -> Server
  4. Enter any meaningful name in Name
  5. Under the Connection tab supply the following values
Field Value
Host name / address db
Port 5432
Username gwells
Password test1

Visit the following links to browse the API and frontend applications:

Running tests:

For comprehensive testing information visit the Wiki Postman API tests: Import the json test collections in the api-tests/ folder into Postman.

Import a Shapefile

Single shapefile, with aquifer ID specified in CLI.

docker-compose exec backend python manage.py import_shapefile 2 aquifers/fixtures/shp/shapefile.zip

Bulk import, requires the AQ_NUMBER attribute on each polygon. Requires a folder with shapefiles to be prepared and passed in (zipped or not). Note: if DEBUG=True, all geometries will be uploaded to a random aquifer instead of the one matching its' number, so we can test locally with a development database.

mkdir app/backend/bulk
mv DATABC_EXPORT_FILE.zip app/backend/bulk/

docker-compose exec backend python manage.py import_bulk_shapefile bulk

Importing Licences

To download new licence data from DataBC and merge it into your DB, do

docker-compose exec backend python manage.py import_licences

Making pull requests

Pull requests made from branches in the bcgov/gwells repo will kick off a dev pipeline, which runs tests and deploys a preview environment containing your changes. The pull request page will update when the environment is deployed and mandatory checks (unit tests, etc.) pass or fail.

Architecture

GWELLS uses PostgreSQL (with PostGIS), Django REST Framework, and Vue.js. We also use both AWS S3 and a self-hosted Minio service for storing documents.

Our production and staging environments run on an OpenShift container platform cluster. OpenShift templates for services are located in the openshift/ folder, along with more information about dev and staging environments on our cluster.

GWELLS container diagram

Contributing

Government employees, the public and members of the private sector are encouraged to contribute. Please read and follow our Code of Conduct.

All contributors retain original copyright, but are granting a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users. This project is covered by an Apache v2.0 license.

Code With Us

Many of our features have been developed by members of the community. Check the BC Developer Exchange website, where paid opportunities to build features for GWELLS and other applications are posted.

License

Code released under the Apache License, Version 2.0.

Additional Documentation

More documentation for the repository can be found in the following places

gwells's People

Contributors

acatchpole avatar alexzorkin avatar banders avatar bcgov-csnr-cd avatar bparees avatar calouie avatar christopher-walsh22 avatar cole avatar countable avatar cvarjao avatar cwevans avatar dainetrinidad avatar danbigthink avatar davidclaveau avatar derekroberts avatar fieranmason avatar garywong-bc avatar garywong-bc-bot avatar georgewalker avatar kuanfandevops avatar localnewstv avatar norrisng-bc avatar rfb avatar rhcarvalho avatar rstens avatar sanjaytkbabu avatar seamus-oconnor avatar sethgreylyn avatar stephenhillier avatar sybrand avatar

Stargazers

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

Watchers

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

gwells's Issues

Convert Hydraulic Conductivity (k) from a Text field to a number field

As a (User Type/Persona) I want the hydraulic conductivity field to only display numbers so that the data is in the correct format and useful.

Additional Context

  • The Hydraulic Conductivity field is current a text field. It should be fixed to be a numbers field.

  • There are 323 records with entries that were all checked to ensure they are numbers, and no text fields.

  • The remaining records are all blank.

  • Values range between 0.22 to 0.000000016 --> but for m/s the value could be as low as 10^-12, so i think 12 values behind the decimal make sense

  • So maybe Number (1,12) for the spatial layer? is that feasible?

  • Relates to https://apps.nrs.gov.bc.ca/int/jira/browse/WATER-2007

Team Review Comments

  • Need to find out where to find this field. it is an external data point, its something that is done on particular wells, often it comes from an environmental consultant running a test
  • SO to confirm where this data is kept and entered

Acceptance Criteria

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

Check for geographic coordinates when entering a new well record fails

When a user is entering a new well record, there should be a check to make sure that one form of geographic coordinates (GPS coordinates, lat/long, or Norting/Easting) has been entered (required field).

We recently came across a new well record (WTN 125242) which had no coordinates entered, so it seems this check is failing or is not implemented correctly.

Please reach out to Carmen Riddel if you require anymore information.

GWELLS: Image Registry using more than allotted space

Describe the task
Clean up unnecessary images and tags in the ImageStreams asap.

Issue:
Platform team has indicated that our "Your namespace d1b5d2-dev is using more than 50Gi in the image registry on the Silver cluster of the Private Cloud OpenShift platform. When the image registry becomes full, none of the product teams working in the Silver cluster will be able to push images to it which will have a negative impact on their ability to run development activities for their apps. "

Notes:
Original email links attached. When you click the links below, you may get a message that says "This type of file can harm your computer. Do you want to keep .msg anyway?". It's okay to click "keep" to access the message.

https://apps.nrs.gov.bc.ca/int/jira/secure/attachment/86364/RE_%20Image%20Registry%20Usage%20Report%20for%20d1b5d2-dev%20-%20WALLY%20%28dev%29%20on%20the%20Silver%20cluster.msg

https://apps.nrs.gov.bc.ca/int/jira/secure/attachment/87205/Image%20Registry%20Usage%20Report%20for%20d1b5d2-dev%20-%20WALLY%20%28dev%29%20on%20the%20Silver%20cluster.msg

Acceptance Criteria

  • first
  • second
  • third

Additional context
There are likely images not being used anymore. Folders with images are taking up space. Currently no automation to remove them (e.g. CRON job)

All attachments disappear when new attachment added

Describe the Bug
When new attachments are added to records all of the attachments disappear. When you return to the well summary after editing it shows "Unable to retrieve file list." When you go back into edit it does not show any attachments.

Initially found with WTN 67013. Noticed the same thing with WTN 114569 and WTN 123917.

Expected Behaviour
When an attachment is added, it is added and all attachments are preserved.

Actual Behaviour
When an attachment is added, other attachments are removed. When they go to view attachments, they can only see the existence of them in "edit" mode.

** Steps To Reproduce**
Look at images below

image.png

image.png

image.png

image.png

image.png

Aquifer Notations on Map Hover

As a Hydrogeologist I want Aquifer Notations displayed when I hover an Aquifer So That I do not need to click into each Aquifer to see notations

Additional Context

  • Notations in Full description form
  • Hover Functionality already exists, this is just adding the Notations to that hover pop up

Acceptance Criteria

  • Given I am looking at the Aquifers in the map view, When Hover an Aquifer with Notations, Then the related Aquifer Notations are displayed
  • Given I am looking at the Aquifers in the map view, When Hover an Aquifer without Notations, Then No Aquifer Notations Message is displayed

Alternative Specs displayed twice on well summary page

Describe the Bug
The alternative specs field is displayed twice on the well summary page.

When was it identified?
March 2021, during testing of the flowing artesian well enhancements.

What are the implications?
Implications and risk is low; however, may cause user confusion as to why there are two fields being displayed for the same information. Looks unprofessional.

DEVELOPMENT CHECKLIST:

Remove one of the alternative specs fields from display.
Make sure boolean displayed correctly
TBC - which one should be removed from the form (no significant preference, but does make sense to keep near bottom)

Additional Context:
We want to get rid of the bottom "alternative specs" text because they don't always say the same thing.

WIREFRAME:
image.png

Notes:

  • When testing again on May 26, 2020, the two alternative specs fields had different values (see screen shots above). I'm 99% sure Dan fixed this before he left. See Staging well record WTN 112567 for an example https://testapps.nrs.gov.bc.ca/gwells/well/112567
  • Backlog grooming: Leia indicates usage of field is low, but if it is easy to do, let's get it done.

Additional comments can be found here:
https://apps.nrs.gov.bc.ca/int/jira/browse/WATER-1703

image.png

image.png

Aquifer Notation has full description

As a General public user I want a full description of the Aquifer notation rather than the abbreviation So That I can understand what the notation means

Additional Context

  • Need List of Abbreviations and definitions from Service Owner
    • FR = Fully Recorded
    • PWS = Potential Water Shortage

Acceptance Criteria

  • Given an Aquifer has a notation, When I go to the aquifer notation section of the aquifer page, Then the notation is listed in the unabbreviated form

Provide Access to GWELLS DB for Service Owner

As a Service Owner I want to be able to query the DB So That I can pull data for reports

Additional Context

  • we are giving Service Owner access to the DB as she knows how to write SQL queries
  • this is a short term solution with the long term solution being to implement something like metabase so more people have access to the data
  • Julian to add details of what needs to change

Acceptance Criteria

  • Service Owner can query DB
  • Service owner knows what they are not allowed to do in the DB

Investigate if Certbot renewal is automated for GWELLS

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 GWELLS?
  • If Certbot is automated for GWELLS, does the renewal date align with the cert expiration?

Advanced search on Aquifer Notations

As a Hydrogeologist or Ground Water Data Specialist I want to be able to search on all Aquifers with Aquifer Notations So That we can compile lists of all aquifers with specific notations at any given time

Additional Context

  • the aquifer advanced search feature already exists, this ticket is only to add Aquifer notations as a searchable field
  • once we confirm where the data is living (either in a DB or being pulled live from the source) in a prior ticket we should re-estimate.

Acceptance Criteria

  • Given I am using the Aquifer Advanced Search, When I search for a specific Aquifer Notation, Then only results with that specific notation are displayed

Well Driller/Pump Installer Registry - Qualified to Drill auto selection broken

The auto selected "qualified to drill" section is not being auto populated when a classification is added to an existing driller/pump installer. It appears to work fine when a new one is added.

WHEN WAS IT IDENTIFIED?
January 2021

WHAT IS THE IMPACT?
Applications for registration as drillers or well pump installers are missing information required under the Act.

NOTES:
Identified during testing of OpenShift4 migration; however, issue exists in PROD.

https://apps.nrs.gov.bc.ca/int/jira/browse/WATER-1607

image-2021-03-31-11-59-16-211.png

Setup Github Actions Pipeline for GWELLS

Describe the task
The Jenkins Pipeline for GWELLS 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
  • understand the full scope of setting up github actions as the new pipeline for GWELLS
  • copy over Open shift commands to GA
  • translate existing commands in Jenkins to Github Actions

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
  • Something in the Jenkins build of the environment is failing, not something in OpenShift

Update Spatial Layer Field Lengths

Describe the task
In the attached excel spreadsheet, 34 cells within Column F (only the highlighted yellow fields) require data length.

The example given for data length: For Number type, format using: Precision (total number of digits) and Scale (number of digits to the right of the decimal point), e.g., 9,3

Required by DataBC to complete spatial layer modeling.

https://apps.nrs.gov.bc.ca/int/jira/secure/attachment/79746/Dataset_Model_groundwater_wells_20211013_UPDATED.xlsx

Acceptance Criteria

  • first
  • second
  • third

Additional context
Can we get some more clarification on what this ticket is asking? Reach out to GWELLS Service Owner

Action:

  • Needs update to API so iMap spatial layer pulls from the correct data column
  • Check with Brad Sparks (DataBC) for any info he may have

use Github Actions to deploy GWELLS changes to environments

Describe the task
once the pipeline is shifted to Github Actions we still need to figure out how to make it actually deploy. translating the broken pipeline means there is still things that need to be fixed.

Acceptance Criteria

  • 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 want to follow this deployment path: On PR Creation -> New Build -> New build is pushed to dev (and test but dev is more important to get working first) -> Testing and review is done -> Command is used in terminal to deploy to prod -> PR is Merged

Missing 'pre' lifecycle hook

When the database pod is not yet available the mid lifecycle hook fails. We can avoid that by adding a pre lifecycle hook that will wait (Retry) until the database pod is up.
something along the lines of the existing Init Containers which protects the pod form startup if the database is not available, but it doesn't protect against the deployment.

Reference

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!

Aquifer summary artesian well count being cached

When a new well activity report (with flowing artesian conditions) is submitted (e.g., well construction) and then associated to an aquifer, the aquifer summary report total artesian wells count is not updated until I refresh or bounce between pages several times. 

When was it identified?
April 2021 as part of testing of WATER-1753

What is the impact?
Confusion - perception is that the update didn't happen and that the system has a bug or is broken.

DEVELOPMENT CHECKLIST:

'Never cache'
Make sure aquifer data endpoint is set to never cache
Update API tests

NOTES:

Ticket a result of testing of WATER-1753
Standup (April 21, 2021) - team indicated that it might be a caching issue

image-2021-06-10-11-32-49-720.png

https://apps.nrs.gov.bc.ca/int/jira/browse/WATER-1804

Unable to update Well Activity Dates

Users are not currently able to edit the dates in the "Well Activity" table. They can update the "Well Work Dates", but the "Well Activity" dates are pulled from elsewhere.

Typically, when a user updates the construction date in "Well Work Dates", this change also needs to be in "Well Activity"

As seen in the attached image, a user changed the "Well Work Date" to 1975 and this change was not reflected under "Well Activity" (still says 1974).

Jira GWELLS-56

GWELLS_WellActivity.png

understand and fix sonarcloud security issues

Describe the task
Sonarcloud blocked the merging of a PR, we want to understand why and fix those issues.

Acceptance Criteria

  • explore how sonarcloud works and what it is looking for
  • fix security issues
  • share findings with team

Additional context

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

Coastal Aquifer notations based on location

As a Hydrogeologist I want *to have a notation indicating "Potential Salt Water Intrusion" added when an aquifer with the Potential Water Shortage notation is indicated and the aquifer is X km from the edge of the coast * So That we do not need to manually ID these Aquifers

Additional Context

  • SO will give us the parameters for how far from the shore/edge of the coastal polygon we want this rule to extend.
  • SO to confirm if there are other types of Conditional Notations

Acceptance Criteria

  • Given an Aquifer has the Potential Water Shortage notation, When that Aquifer is X Km from the South/West Coast, Then an additional "Potential Saltwater Intrusion" Notation is added to that Aquifer
  • Given an Aquifer has lost the Potential Water Shortage notation, When that Aquifer is X Km from the South/West Coast, Then an additional "Potential Saltwater Intrusion" Notation is Removed from that Aquifer

Aquifer Notation added to Aquifer Summary Pages (Abbreviations)

As a Hydrogeologists I want to see the Aquifer Notations on the Aquifer page So That it can Inform decisions on changing licenses or limit the water coming out of an aquifer

Additional Context

  • Currently, the idea is to replace "Pumping Stress Index" with an "Aquifer Notation" section and list any notations there. Pumping Stress Index is no longer desired to be in the summary pages.
  • The layer is updated nightly. It currently only has short form of the notations
  • new data source being pulled in a familiar way, need to determine whether it needs to go into a DB or if it is pulling the data live from the source
  • https://bcgov.github.io/data-publication/pages/dps_data_distribution_w.html

Acceptance Criteria

  • Given an Aquifer with Aquifer Notations is selected, When you scroll to the Aquifer Notations, Then the aquifer notations are listed in Abbreviated form
  • Given an Aquifer without Notations is selected, When you scroll to the Aquifer Notations, Then the aquifer notation section says something along the lines of "there are not aquifer notations at this time, this is updated daily"

Alteration Report Assigned to wrong WTN

Describe the task
Issue: An alteration report was created and assigned to a Well Tag Number (WTN) 41359.

This alteration report should have a new WTN, and should NOT have been assigned to an existing WTN.

Issue occurred and was reported on 7 Oct 2021.

This is a database entry that needs to be deleted.

Acceptance Criteria

  • Reach out to Carmen and confirm they have the details for the alteration report so they can re-submit it
  • Delete alteration report from back end so it is not linked to WTN 41359
  • Let GWELLS Service Owner (Leia) know once it's removed and I will ask the contractor to enter the info again as a new submission.

Additional context

Poor data quality, and known misinformation of well data
erodes confidence in data, and its incorrect.
Its only one well, but it shouldnt get forgotten, when we know its wrong, and not within current GWELLS application capacity to easily fix it.

Fix GWELLS Django tests for latest build

Describe the task
A number of tests need to be updated to account for the recently updated schema.

Acceptance Criteria

  • first
  • second
  • third

Additional context

  • N/A

GWELLS 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

Well Driller Registry REST API

https://bcdevexchange.org/opportunities/opp-well-driller---pump-installer-registry-rest-api

Work in an Agile Scrum environment to create a proof of concept for a Well Driller Registry in the GWELLS app.

Background
The GWELLS team released the first version of its Provincial repository for groundwater well data and information. We’d like to build on that success by implementing an API proof of concept which will support external access to groundwater well data and enable future front-end development of GWELLS.

This next phase of development will be to set up an API for a registry of well drillers. We’d like a good base from which to start, and have scoped this out into three milestones:

Milestone 1: Django REST API
Create an API with end points to support basic CRUD operations on a well drillers table. Data models will be provided by GWELLS team members. Operations will be authenticated and authorized against RedHat Single Sign-On (RH-SSO), an on-premises version of KeyCloak.

Milestone 2: Well driller registry integration
Create basic web views for listing all well drillers from the API and a details page for a single driller with basic CRUD operations using Vue.js. These pages will serve as a base for our in-house team to work from.

Milestone 3: Integrate with the Data BC API Gateway
Deploy to the Data BC API Gateway.

The fixed-price reward is for a total of $10,000* for fulfilling the Acceptance Criteria below, per this payment schedule:

Completion of milestone 1 - $4,000
Completion of milestone 2 - $3,500
Completion of milestone 3 - $2,500

*The full amount is dependent on an evaluation of outputs at the end of milestone 1, and the end of milestone 2. After each milestone, the Province will determine whether or not work will continue.

Acceptance Criteria
To be paid the fixed price for this opportunity, you need to meet all of the following criteria:

  • Work with our Agile/Scrum team (1012 Douglas Street in Victoria, BC):
    • The GWELLS team works in 2-week sprints. You will attend in person planning (2 hours) and review (3 hours) meetings for each sprint.
    • You will track your work with the team on our GWELLS Trello board
  • Milestone 1
    • Create a well driller model
    • Create 5 end points for a well driller registry with the Django REST framework:
      • View all drillers (list)
      • Add a driller (create)
      • View single driller (read)
      • Edit a driller (update)
      • Delete a driller (destroy)
    • Authenticate edit/update/destroy end points
    • Document the API using Django REST Swagger
    • Write automated tests for our Jenkins pipeline in Postman/Newman
    • Submit pull requests for review/acceptance
  • Milestone 2
    • Using Vue.js, create web views for our python/django app:
    • A grid (table) of all drillers
    • A driller details page with CRUD operations
    • Select and implement a Vue.js plugin for sorting and filtering grid results
    • Display error and success messages where applicable
    • Hide/show links to operations
    • Submit pull requests for review/acceptance
  • Milestone 3
    • Work with the GWELLS lead technical architect to publish ‘List’ and ‘Read’ end points to the Data BC API Gateway

Proposal Evaluation Criteria
Your proposal will be scored by this criteria:

  • Your approach to completing the Acceptance Criteria (30 points).
  • Your prior experience writing APIs and javascript-based applications (30 points).
  • Your expertise in our technology stack (see Required skills) and experience contributing code to public code repositories (20 points).
  • To qualify for assignment your proposal must meet a minimum pass rate of 80% (Mandatory).
  • With your proposal, you must attach a copy of the Code With Us terms, with the required information asked for in the "Acceptance" section of the Terms inserted into the document (Mandatory).

Required skills: API, Microservices, Swagger, Openshift, Docker, JavaScript, Python, Django, Vue, Bootstrap, Postman, Newman, Jenkins

Questions?
Post a comment here and we'll get back to you as soon as possible.

Set up GWELLS

Describe the task
Developers have GWELLS set up locally.

Acceptance Criteria

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

Additional context
N/A

Artesian conditions not displaying correctly in spatial layer

Describe the Bug
What is needed: add Artesian_Conditions flag field to the API.

Why it is needed: The GWELLS application has a new field for an Artesian Conditions flag (Jira ticket WATER-639) that should’ve been added into V2 of the API. Brad searched the new API and didn’t see this new field in there. So a couple questions for Alex:

Is this new Artesian Conditions flag field in V2 API and maybe we just didn’t see it?
Or
Was it excluded intentionally for some reason that we weren’t aware of? E.g., maybe there were issues with it and they didn’t want it added to the API?
If it was an oversight and didn’t get added to the API but should have, the Artesian_Conditions flag field needs to be added to the API.

A bit more background: Up until the end of 2021 GWELLS did not have an Artesian Conditions flag. The only way to indicate artesian conditions was to enter an artesian flow value for a well. If the flow was unknown, then we entered a dummy value (0.01 usGPM). In order to symbolize artesian wells on the spatial layer, we created a temporary “artesian indicator” field (in the spatial layer only) that auto-populated based on calculation of artesian flow (i.e., “N” if artesian flow were null or 0, or else “Y”). Hydrogeologists reported that these dummy values caused issues with skewed data calculations, etc. So we decided to create a new flag that would indicate artesian conditions whether the flow was known or not.

The flag was created in GWELLS and works perfectly there. However, the spatial layer is still using the temporary artesian indicator that is populated based off the Artesian flow calculation. So the spatial layer is only drawing artesian wells for those that have an artesian flow entered (regardless of whether the artesian flag indicates ‘Y’). When the API was updated in December, this new flag should have been added to the API (this step was missed), so that the spatial layer could then be symbolized based on this flag (instead of the temporary calculated indicator).

Timing Implications: A&WS has budget remaining in for FY21/22 for updating the spatial layers. If the API V2 is updated quickly, we may undergo another re-modelling exercise with DataBC to update the spatial datasets this fiscal.

Expected Behaviour
Artesian_Conditions flag has been added to the API and spatial layer is symbolized based on this flag.

Actual Behaviour
The spatial layer is only drawing artesian wells for those that have an artesian flow entered (regardless of whether the artesian flag indicates ‘Y’)

** Steps To Reproduce**
None available

Notes:
Need to create a column in the database and added to API. Or it could still be in the database?
Or API for spatial layer is not calling for this info?

Debug Pipeline Issues

Describe the task
The build pipeline is timing out on the tests stage. Need to determine root cause of error and implement fix.

Acceptance Criteria

  • first
  • second
  • third

Additional context

  • Currently no documentation on the GWELL pipeline. Sybrand will be a helpful resource for this task. Needs some research, but will mostly be de-bugging.

Explore how GWELLS is using Keycloak

Describe the task
Explore the use of Keycloak with GWELLS.

Acceptance Criteria

  • How is GWELLS 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 GWELLS
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

add Metabase to GWELLS

As a ground water data specialist I want the ability to query the database So That I can compile data for reports and research

Additional Context

  • we want to see how much effort it would be to add metabase to GWELLs

Acceptance Criteria

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

Keep Unknown Water Use when editing historical records, but do not allow it for new ones

If a legacy record had "unknown" entered in both the "Class of Well" and "Intended Water Use" fields, then the user will get an error message when they try to save the record (if it is the first time that the record has been opened since it was imported in GWELLS). The error message says "unknown water use only valid for water supply". 

If you then change the "Class of Well" field to "water supply" in order to correct this and save your work, you get the following error message, "intended water use is required when class is water supply". 

The workaround is to change the "Class of Well" field back to "unknown", at which point the "Intended Water Use" field will become greyed out and you can save the record, but this is time consuming when accessing and saving multiple historical records. 

It would be ideal if for historical records, 'Unknown' is allowed for both Class of Well and Intended Water Use (no error message pops up when saving them), but for new records, 'Unknown' Intended Water Use is only available as an option for Class of Well = water supply. 

Jira GWELLS-55

Remove Pumping Stress Index - Aquifers

As a Ground Water Scientist I want to no longer see Pumping Stress Index So That My interpretation of the data isnt tainted by inaccurate data

Additional Context

  • Pumping Stress Index is not accurate and needs to be removed from the Aquifer summary pages as well as the advanced search in GWELLS.
  • theres no secondary data sources dependent on PSI
  • the space left by removing PSI will be used to add in the new data from the Aquifer Notations Layer

Acceptance Criteria

  • Given I am looking at an Aquifer on GWELLS, When I Scroll to where Pumping Stress Index used to be, Then that space is empty

https://apps.nrs.gov.bc.ca/int/jira/projects/GWELLS/issues/GWELLS-59

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 :)

Aquifer Data and Information

Work in an Agile Scrum environment to create an Aquifer application to help support the management of aquifer data and information in the Province of B.C.
Value: $10,000
Work Location: Victoria
On-Site Requirements: Some in-person work required
Tags: API, Microservices, Swagger, Openshift, Docker, JavaScript, Python, Django, Vue, Bootstrap, Postman, Newman, Jenkins
Government Contact: Lindsay Macfarlane
Program: Water Protection and Sustainability
Project: GWELLS
Code: GitHub Repository
Background
The Groundwater Wells and Aquifers (GWELLS) team has released a well search and summary page, and the Register of Well Drillers and Well Pump Installers. We want to build on our success by implementing backend and user interface for entering and editing aquifer data.
This next phase of development will be to set up an API and user interface for aquifer data and information. We have scoped this out into three milestones:
Milestone 1: Search
Create a Django REST API and front end Vue application, which lists, sorts and filters aquifer data and information. Data models will be provided by GWELLS team members, but may require changes based on a user centred iterative process for development.

Milestone 2: CRUD Aquifer Data
Create web views for viewing, creating, editing and deleting aquifer data. Operations will be authenticated and authorized against RedHat Single Sign-On (RH-SSO), an on-premises version of KeyCloak.

Milestone 3: Integrate with the Data BC API Gateway
Deploy to the Data BC API Gateway.
The fixed-price reward is for a total of $10,000* for fulfilling the Acceptance Criteria below, per this payment schedule:
• Completion of milestone 1 - $4,000
• Completion of milestone 2 - $3,500
• Completion of milestone 3 - $2,500
*The full amount is dependent on an evaluation of outputs at the end of milestone 1, and the end of milestone 2. After each milestone, the Province will determine whether or not work will continue.
Acceptance Criteria
This is a fixed-price opportunity governed by the terms of our lightweight procurement model, Code With Us.
To be paid the fixed price for this opportunity, you need to meet all of the following criteria:
• Work with our Agile/Scrum team (2975 Jutland in Victoria, BC):
o The GWELLS team works in 2-week sprints. You will attend in person planning (2 hours) and review (2 hours) meetings for each sprint.
o You will track your work with the team on our GWELLS Trello board
• Milestone 1
o Update aquifer model, based on application development, when required throughout development process.
o Create a Django REST API and front end Vue.js Aquifer single page application (SPA)
i. View all aquifers (list)
o Implement a Vue.js plugin for sorting and filtering grid results
o Document the API using Django REST Swagger
o Write automated tests for our Jenkins pipeline in Postman/Newman
o Submit pull requests for review/acceptance
• Milestone 2
o Create views in the aquifers application to support CRUD operations:
.
i. Add an aquifer (create)
ii. View single aquifer (read)
iii. Edit an aquifer (update)
iv. Delete an aquifer (destroy)
o Display error and success messages where applicable
o Hide/show links to operations
o Authenticate edit/update/destroy end points
o Document the API using Django REST Swagger
o Write automated tests for our Jenkins pipeline in Postman/Newman
o Submit pull requests for review/acceptance
• Milestone 3
o Work with the GWELLS lead technical architect to publish ‘List’ and ‘Read’ end points to the Data BC API Gateway

Fix GWELLS Jenkins pipeline issues

Describe the task
Fix the issues preventing us from deploying to GWELLS with Jenkins

Acceptance Criteria

  • The product build completes without errors
  • All backend and frontend tests pass
  • The product can be deployed to a DEV environment

Review and Address Vulnerabilities

I came across this Jira issue. Not sure how it factors into your own determination of vulnerabilities..?

Review and address vulnerabilities found with GWELLS. 

DEVELOPMENT CHECKLIST: 

Review attached spreadsheet provided by Nick C on May 28, 2021
Fix the three critical vulnerabilities
Test
Develop plan to address the remainder of the vulnerabilities
Create new Jira tickets to address 
Provide feedback to Nick C. on spreadsheet and approach

NOTES:

Risks: this might open up some cans of worms
Nick's recommended approach to prioritization is: 
Critical/High with an exploit and a fix
Medium with remote exploit and a fix
Critical/High where possible
Team indicates that this is not technical debt, but regular maintenance that we need to stay on top of

Jira WATER-1873

https://app.zenhub.com/files/83460090/db3058c2-2d31-4694-bf83-7fc8006137e3/download

Deploy GWELLS change to Prod

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

Acceptance Criteria

  • GWELLS#1818
  • We have an understanding of how to deploy code to GWELLS

Additional context

  • We will have one of these tickets for each repository

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.

Convert Hydraulic Conductivity (k) from a Text field to a number field

Describe the task
The Hydraulic Conductivity field is current a text field. It should be fixed to be a numbers field.

There are 323 records with entries that were all checked to ensure they are numbers, and no text fields.

The remaining records are all blank.

Values range between 0.22 to 0.000000016 --> but for m/s the value could be as low as 10^-12, so i think 12 values behind the decimal make sense

So maybe Number (1,12) for the spatial layer? is that feasible?

Acceptance Criteria

  • first
  • second
  • third

Additional context
Relates to https://apps.nrs.gov.bc.ca/int/jira/browse/WATER-2007

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.