Skip to content

Commit

Permalink
Merge pull request #5 from bcgov/chore/consistency
Browse files Browse the repository at this point in the history
Improve Developer Experience, Consistency and Formatting
  • Loading branch information
abimichel authored Sep 10, 2024
2 parents 1c4ef9a + 93ae790 commit 0552717
Show file tree
Hide file tree
Showing 99 changed files with 4,461 additions and 2,393 deletions.
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.html]
indent_style = tab
indent_size = 4

[*.sql]
indent_style = tab
indent_size = 4

[*.py]
indent_style = space
indent_size = 4

[*.{css,js,json,jsx,scss,ts,tsx,vue}]
indent_style = space
indent_size = 4

[.{babelrc,eslintrc}]
indent_style = space
indent_size = 4
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Autodetect text files and forces unix eols, so Windows does not break them
* text=auto eol=lf

# Force images/fonts to be handled as binaries
*.jpg binary
*.jpeg binary
*.gif binary
*.png binary
29 changes: 29 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- Provide a general summary of your changes in the Title above -->
# Description

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->

## Types of changes

<!-- What types of changes does your code introduce? Uncomment all that apply: -->

<!-- Bug fix (non-breaking change which fixes an issue) -->
<!-- New feature (non-breaking change which adds functionality) -->
<!-- Documentation (non-breaking change with enhancements to documentation) -->
<!-- Breaking change (fix or feature that would cause existing functionality to change) -->

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] I have read the [CONTRIBUTING](CONTRIBUTING.md) doc
- [ ] I have checked that unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)

## Further comments

<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->
2 changes: 1 addition & 1 deletion .github/workflows/docker-ora2s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Push to GHCR

on:
push:
branches: [ "main" ]
branches: ["main"]

env:
REGISTRY: ghcr.io
Expand Down
49 changes: 45 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
.env
.txt
.vscode
# Editor directories and files
.cred
shared/geospatial/workspace
.DS_Store
.gradle
.nyc_output
.scannerwork
# .vscode
build
coverage
dist
files
**/e2e/videos
node_modules
shared/geospatial/workspace

# Ignore only top-level package-lock.json
/package-lock.json

# Ignore Helm subcharts
charts/**/charts
Chart.lock

# local env files
*local.*
*local-*.*
.env
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
*.iml
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.mp4

# temp office files
~$*
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"adpyke.vscode-sql-formatter",
"bierner.markdown-preview-github-styles",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"ms-python.autopep8",
"ryanluker.vscode-coverage-gutters"
]
}
31 changes: 31 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
"[sql]": {
"editor.defaultFormatter": "adpyke.vscode-sql-formatter"
},
"coverage-gutters.showGutterCoverage": false,
"coverage-gutters.showLineCoverage": true,
"editor.defaultFormatter": "vscode.html-language-features",
"editor.formatOnSave": true,
"eslint.format.enable": true,
"files.insertFinalNewline": true,
"sql-formatter.uppercase": true,
"sql-formatter.dialect": "pl/sql"
}
46 changes: 46 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at <[email protected]>. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
11 changes: 11 additions & 0 deletions COMPLIANCE.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: compliance
description: |
This document is used to track a projects PIA and STRA
compliance.
spec:
- name: PIA
status: TBD
last-updated: "2024-08-16T00:00:00.000Z"
- name: STRA
status: TBD
last-updated: "2024-08-16T00:00:00.000Z"
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# How to contribute

Government employees, public and members of the private sector are encouraged to contribute to the repository by **forking and submitting a pull request**.

(If you are new to GitHub, you might start with a [basic tutorial](https://help.github.com/articles/set-up-git) and check out a more detailed guide to [pull requests](https://help.github.com/articles/using-pull-requests/).)

Pull requests will be evaluated by the repository guardians on a schedule and if deemed beneficial will be committed to the master.

All contributors retain the original copyright to their stuff, but by contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users **under the terms of the [license](./LICENSE) under which this project is distributed**.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 Province of British Columbia

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# nr-dap-ods

This repository holds code and artifacts for the Data Analytics Platform (DAP).

The Operational Data Store (ODS) provides access to exact copies of data assets residing in Line of Business databases, as well as data constructs (views, materialized views); that are refreshed on pre-defined schedules (nightly by default, other schedules by exception).
Expand All @@ -23,10 +24,12 @@ The Operational Data Store (ODS) provides access to exact copies of data assets
- **Shared ETL Tools:**
`nr-dap-ods/shared/tools/{name of tool}/{Files}`

## Use of GitHub Container Registry
## Use of GitHub Container Registry

Container images under the 'shared' folder are built automatically and pushed to the GHCR any time there is a push to the **main** branch. Images are named according to the file path and tagged with the branch name. Use the image name in an Airflow DAG to create a job using the shared containers. See Airflow example here: [permitting_ats.py](https://github.com/bcgov/nr-airflow/blob/main/dags/permitting_ats.py)

Usage example:

```sh
docker pull ghcr.io/bcgov/nr-dap-ods-ora2pg:main
```
52 changes: 52 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Security Policies and Procedures

This document outlines security procedures and general policies for the Data
Analytics Platform project.

- [Supported Versions](#supported-versions)
- [Reporting a Bug](#reporting-a-bug)
- [Disclosure Policy](#disclosure-policy)
- [Comments on this Policy](#comments-on-this-policy)

## Supported Versions

At this time, only the latest version of Data Analytics Platform is supported.

| Version | Supported |
| ------- | ------------------ |
| 0.1.0 | :white_check_mark: |
| < 0.1.x | :x: |

## Reporting a Bug

The `DF` team and community take all security bugs in `Data Analytics Platform`
seriously. Thank you for improving the security of `Data Analytics Platform`.
We appreciate your efforts and responsible disclosure and will make every
effort to acknowledge your contributions.

Report security bugs by sending an email to <[email protected]>.

The `DF` team will acknowledge your email within 48 hours, and will send a
more detailed response within 48 hours indicating the next steps in handling
your report. After the initial reply to your report, the security team will
endeavor to keep you informed of the progress towards a fix and full
announcement, and may ask for additional information or guidance.

Report security bugs in third-party modules to the person or team maintaining
the module.

## Disclosure Policy

When the security team receives a security bug report, they will assign it to a
primary handler. This person will coordinate the fix and release process,
involving the following steps:

- Confirm the problem and determine the affected versions.
- Audit code to find any potential similar problems.
- Prepare fixes for all releases still under maintenance. These fixes will be
released as fast as possible.

## Comments on this Policy

If you have suggestions on how this process could be improved please submit a
pull request.
Loading

0 comments on commit 0552717

Please sign in to comment.