Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rajpatel24 committed Nov 4, 2024
2 parents 4c81d76 + bd4824b commit f63d0d3
Show file tree
Hide file tree
Showing 497 changed files with 37,243 additions and 23,164 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const jsRules = {
'react/no-multi-comp': 0,
'react/no-unknown-property': 0,
'react/prop-types': 0,
'react/react-in-jsx-scope': 2,
// 'react/react-in-jsx-scope': 2,
'react/self-closing-comp': 2,
'react/wrap-multilines': 0,
strict: 1,
Expand Down
92 changes: 92 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
## This is a comment.
## Each line is a file pattern followed by one or more owners.
## Last matching line wins.




## Default owner for all missed or newly added files.
* @magicznyleszek @noliveleger



################
#### Global section.
.editorconfig @magicznyleszek
.git-blame-ignore-revs @magicznyleszek
.gitattributes @magicznyleszek @noliveleger
.gitignore @magicznyleszek @noliveleger
CONTRIBUTING.md @magicznyleszek @noliveleger
dependabot.yml @magicznyleszek
kpi.code-workspace @p2edwards
LICENSE @jnm @tinok
README.md @jnm @magicznyleszek @noliveleger

## Translations
.gitmodules @JacquelineMorrissette @jnm
.tx/* @JacquelineMorrissette @jnm




################
#### Frontend section.

# Default owner
.storybook/* @magicznyleszek
cypress/* @magicznyleszek
jsapp/* @magicznyleszek
patches/* @p2edwards
static/* @magicznyleszek
webpack/* @magicznyleszek
.babelrc.json @magicznyleszek
.browserlistrc @magicznyleszek
.eslintignore @magicznyleszek
.eslintrc.js @magicznyleszek
.node-version @magicznyleszek
.nvmrc @magicznyleszek
.prettierrc.js @magicznyleszek
.stylelintrc.js @magicznyleszek
.swcrc @magicznyleszek
.coffeelnt.json @magicznyleszek
package-lock.json @magicznyleszek
package.json @magicznyleszek
tsconfig.json @magicznyleszek

# Billing
/jsapp/js/account/* @jamesrkiger
/jsapp/js/components/usageLimits @jamesrkiger




################
#### Backend section

# Default owner
dependencies/* @jnm @noliveleger
hub/* @jnm @noliveleger
kobo/* @jnm @noliveleger
kobo/apps/audit_log/* @rgraber
kobo/apps/subsequences/* @Guitlle
kpi/* @jnm @noliveleger
test/* @jnm @noliveleger
.coveragerc @jnm
.dockerignore @jnm @noliveleger
format-python.sh @noliveleger
manage.py @jnm @noliveleger
pip-compile.sh @jnm @noliveleger
pyproject.toml @jnm @noliveleger




################
#### Infra section

docker/* @bufke @jnm @noliveleger
scripts/* @bufke @jnm @noliveleger
.github/* @bufke @jnm @noliveleger @magicznyleszek
.gitlab-ci.yml @bufke
Dockerfile @bufke @jnm @noliveleger

8 changes: 7 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
1. [ ] If you've added code that should be tested, add tests
2. [ ] If you've changed APIs, update (or create!) the documentation
3. [ ] Ensure the tests pass
4. [ ] Run `./python-format.sh` to make sure that your code lints and that you've followed [our coding style](https://github.com/kobotoolbox/kpi/blob/master/CONTRIBUTING.md)
4. [ ] Run `./python-format.sh` to make sure that your code lints and that you've followed [our coding style](https://github.com/kobotoolbox/kpi/blob/main/CONTRIBUTING.md)
5. [ ] Write a title and, if necessary, a description of your work suitable for publishing in our [release notes](https://community.kobotoolbox.org/tag/release-notes)
6. [ ] Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
7. [ ] Open an issue in the [docs](https://github.com/kobotoolbox/docs/issues/new) if there are UI/UX changes
8. [ ] Create a testing plan for the reviewer and add it to the Testing section
9. [ ] Add frontend or backend tag and any other appropriate tags to this pull request

## Description

Expand All @@ -16,6 +18,10 @@ Describe the outcome of your work here. A non-programmer who is familiar with Ko

Describe what you've changed and why. This should allow the reviewer to understand more easily the scope of the PR. It's good to be thorough here.

## Testing

Add a testing plan for the reviewer. This should allow the reviewer to test the basic functionality of the new code.

## Related issues

Fixes #ISSUE
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: npm-test

on:
push:
branches: [ master, beta ]
branches: [ main ]
pull_request:

jobs:
Expand Down Expand Up @@ -78,3 +78,6 @@ jobs:
# Timeout early to make it easier to manually re-run jobs.
# Tracking issue: https://github.com/kobotoolbox/kpi/issues/4337
timeout-minutes: 1

- name: Run components tests with Jest
run: npm run jest
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: pytest

on:
push:
branches: [ master, beta ]
branches: [ main ]
pull_request:

jobs:
Expand All @@ -26,7 +26,7 @@ jobs:
KOBOFORM_URL: http://kpi
strategy:
matrix:
python-version: ['3.8', '3.10']
python-version: ['3.10']
services:
postgres:
image: postgis/postgis:14-3.4
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ pages:
- public
only:
refs:
- beta
- main
- storybook
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We use GitHub to host code, to track issues and feature requests, as well as acc

Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:

1. Fork the repo and create your branch from `master`.
1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update (or create!) the documentation.
4. Ensure the test suite passes.
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ENV KPI_LOGS_DIR=/srv/logs \
NGINX_STATIC_DIR=/srv/static \
KPI_SRC_DIR=/srv/src/kpi \
KPI_MEDIA_DIR=/srv/src/kpi/media \
OPENROSA_MEDIA_DIR=/srv/src/kobocat/media \
KPI_NODE_PATH=/srv/src/kpi/node_modules \
TMP_DIR=/srv/tmp \
UWSGI_USER=kobo \
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# KPI

[![Python Build Status](https://github.com/kobotoolbox/kpi/workflows/pytest/badge.svg)](https://github.com/kobotoolbox/kpi/actions?query=workflow%3Apytest)
[![Python Coverage Status](https://coveralls.io/repos/github/kobotoolbox/kpi/badge.svg?branch=master)](https://coveralls.io/github/kobotoolbox/kpi?branch=master)
[![JavaScript Build Status](https://github.com/kobotoolbox/kpi/workflows/npm-test/badge.svg)](https://github.com/kobotoolbox/kpi/actions?query=workflow%3Anpm-test)
[![Python Build Status](https://github.com/kobotoolbox/kpi/workflows/pytest/badge.svg?branch=main)](https://github.com/kobotoolbox/kpi/actions?query=workflow%3Apytest+branch%3Amain)
[![Python Coverage Status](https://coveralls.io/repos/github/kobotoolbox/kpi/badge.svg?branch=main)](https://coveralls.io/github/kobotoolbox/kpi?branch=main)
[![JavaScript Build Status](https://github.com/kobotoolbox/kpi/workflows/npm-test/badge.svg?branch=main)](https://github.com/kobotoolbox/kpi/actions?query=workflow%3Anpm-test+branch%3Amain)

For production always use a specific release branch, `main` branch may include breaking changes. Run `git branch -rl 'origin/release/*'` to list release branches and then switch to a release branch of your choice.

We're open for [contributions](./CONTRIBUTING.md)!

Expand Down
2 changes: 1 addition & 1 deletion dependencies/pip/dev_requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Fabric
coverage
coveralls
ddt
ipython==8.12.3 # Max supported version by Python 3.8
ipython
mock
model-bakery
mongomock
Expand Down
20 changes: 14 additions & 6 deletions dependencies/pip/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ azure-core==1.30.1
# django-storages
azure-storage-blob==12.19.1
# via django-storages
backcall==0.2.0
# via ipython
bcrypt==4.1.2
# via paramiko
begins==0.9
Expand Down Expand Up @@ -139,6 +137,8 @@ deprecated==1.2.14
# via fabric
dict2xml==1.7.5
# via -r dependencies/pip/requirements.in
diff-match-patch==20230430
# via django-import-export
dj-static==0.0.6
# via -r dependencies/pip/requirements.in
dj-stripe==2.8.3
Expand All @@ -158,6 +158,7 @@ django==4.2.15
# django-extensions
# django-filter
# django-guardian
# django-import-export
# django-markdownx
# django-oauth-toolkit
# django-organizations
Expand Down Expand Up @@ -196,6 +197,8 @@ django-filter==24.2
# via -r dependencies/pip/requirements.in
django-guardian==2.4.0
# via -r dependencies/pip/requirements.in
django-import-export==4.1.0
# via -r dependencies/pip/requirements.in
django-loginas==0.3.11
# via -r dependencies/pip/requirements.in
django-markdownx==4.0.7
Expand Down Expand Up @@ -252,7 +255,9 @@ drf-extensions==0.7.1
et-xmlfile==1.1.0
# via openpyxl
exceptiongroup==1.2.0
# via pytest
# via
# ipython
# pytest
execnet==2.1.1
# via pytest-xdist
executing==2.0.1
Expand Down Expand Up @@ -343,7 +348,7 @@ iniconfig==2.0.0
# via pytest
invoke==2.2.0
# via fabric
ipython==8.12.3
ipython==8.28.0
# via -r dependencies/pip/dev_requirements.in
isodate==0.6.1
# via azure-storage-blob
Expand Down Expand Up @@ -392,6 +397,8 @@ modilabs-python-utils==0.1.5
# via -r dependencies/pip/requirements.in
mongomock==4.1.2
# via -r dependencies/pip/dev_requirements.in
more-itertools==10.4.0
# via -r dependencies/pip/requirements.in
multidict==6.0.5
# via
# aiohttp
Expand Down Expand Up @@ -430,8 +437,6 @@ pathspec==0.12.1
# via black
pexpect==4.9.0
# via ipython
pickleshare==0.7.5
# via ipython
pillow==10.3.0
# via django-markdownx
platformdirs==4.3.2
Expand Down Expand Up @@ -610,6 +615,8 @@ statistics==1.0.3.5
# via formpack
stripe==4.2.0
# via dj-stripe
tablib==3.5.0
# via django-import-export
tabulate==0.9.0
# via -r dependencies/pip/requirements.in
toml==0.10.2
Expand All @@ -636,6 +643,7 @@ typing-extensions==4.10.0
# azure-core
# azure-storage-blob
# black
# ipython
# jwcrypto
# psycopg
tzdata==2024.1
Expand Down
2 changes: 2 additions & 0 deletions dependencies/pip/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ django-csp
django-debug-toolbar
django-environ
django-filter
django-import-export
django-extensions
django-oauth-toolkit
django-organizations
Expand Down Expand Up @@ -67,6 +68,7 @@ jsonfield
jsonschema
kombu
lxml
more-itertools
oauthlib
openpyxl
#py-gfm # Incompatible with markdown 3.x
Expand Down
9 changes: 9 additions & 0 deletions dependencies/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ defusedxml==0.7.1
# pyxform
dict2xml==1.7.5
# via -r dependencies/pip/requirements.in
diff-match-patch==20230430
# via django-import-export
dj-static==0.0.6
# via -r dependencies/pip/requirements.in
dj-stripe==2.8.3
Expand All @@ -125,6 +127,7 @@ django==4.2.15
# django-extensions
# django-filter
# django-guardian
# django-import-export
# django-markdownx
# django-oauth-toolkit
# django-organizations
Expand Down Expand Up @@ -162,6 +165,8 @@ django-filter==24.2
# via -r dependencies/pip/requirements.in
django-guardian==2.4.0
# via -r dependencies/pip/requirements.in
django-import-export==4.1.0
# via -r dependencies/pip/requirements.in
django-loginas==0.3.11
# via -r dependencies/pip/requirements.in
django-markdownx==4.0.7
Expand Down Expand Up @@ -316,6 +321,8 @@ markupsafe==2.1.5
# via werkzeug
modilabs-python-utils==0.1.5
# via -r dependencies/pip/requirements.in
more-itertools==10.4.0
# via -r dependencies/pip/requirements.in
multidict==6.0.5
# via
# aiohttp
Expand Down Expand Up @@ -472,6 +479,8 @@ statistics==1.0.3.5
# via formpack
stripe==4.2.0
# via dj-stripe
tablib==3.5.0
# via django-import-export
tabulate==0.9.0
# via -r dependencies/pip/requirements.in
tornado==6.4
Expand Down
17 changes: 13 additions & 4 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,19 @@ fi
echo 'Restore permissions on logs folder'
chown -R "${UWSGI_USER}:${UWSGI_GROUP}" "${KPI_LOGS_DIR}"

# This can take a while when starting a container with lots of media files.
# Maybe we should add a disclaimer as we do in KoBoCAT to let the users
# do it themselves
chown -R "${UWSGI_USER}:${UWSGI_GROUP}" "${KPI_MEDIA_DIR}"
# `chown -R` becomes very slow once a fair amount of media has been collected,
# so reset ownership of the media directory *only* (i.e., non-recursive)
echo 'Resetting ownership of media directories...'
chown "${UWSGI_USER}:${UWSGI_GROUP}" "${KPI_MEDIA_DIR}"
chown "${UWSGI_USER}:${UWSGI_GROUP}" "${OPENROSA_MEDIA_DIR}"
echo 'Done.'
echo '%%%%%%% NOTICE %%%%%%%'
echo '% To avoid long delays, we no longer reset ownership *recursively*'
echo '% every time this container starts. If you have trouble with'
echo '% permissions, please run the following command inside the KPI container:'
echo "% chown -R \"${UWSGI_USER}:${UWSGI_GROUP}\" \"${KPI_MEDIA_DIR}\""
echo "% chown -R \"${UWSGI_USER}:${UWSGI_GROUP}\" \"${OPENROSA_MEDIA_DIR}\""
echo '%%%%%%%%%%%%%%%%%%%%%%'

echo 'KPI initialization completed.'

Expand Down
Loading

0 comments on commit f63d0d3

Please sign in to comment.