Skip to content

Commit

Permalink
Merge pull request #4152 from mathesar-foundation/0.2.0
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
pavish authored Jan 28, 2025
2 parents c860063 + e18be8b commit a5328e9
Show file tree
Hide file tree
Showing 1,535 changed files with 62,754 additions and 631,879 deletions.
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
ALLOWED_HOSTS='.localhost, 127.0.0.1, [::1]'
ALLOWED_HOSTS=.localhost,127.0.0.1,[::1]
SECRET_KEY=2gr6ud88x=(p855_5nbj_+7^bw-iz&n7ldqv%94mjaecl+b9=4
## Uncomment the setting below to put Mathesar in 'demo mode'
# DJANGO_SETTINGS_MODULE=demo.settings
2 changes: 1 addition & 1 deletion .github/sync.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mathesar-foundation/mathesar-ansible:
mathesar-foundation/mathesar-infrastructure:
- .github/workflows/toc.yml
- .github/workflows/stale.yml
mathesar-foundation/mathesar-data-playground:
Expand Down
32 changes: 4 additions & 28 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,15 @@ jobs:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

# Learn more: https://docs.github.com/en/code-security/code-scanning
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
59 changes: 0 additions & 59 deletions .github/workflows/run-e2e-integ-tests.yml.disabled

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
staging-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout ansible repo
- name: Checkout infrastructure repo
uses: actions/checkout@v2
with:
repository: 'mathesar-foundation/mathesar-ansible'
repository: 'mathesar-foundation/mathesar-infrastructure'
token: ${{ secrets.MATHESAR_ORG_GITHUB_TOKEN }} # Repo is private, so an access token is used
# This checkout is used for getting the 'action' from the current repo
- name: Checkout mathesar repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-github-labels-milestones.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: composer global require 'vanilla/github-sync'
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-ansible -d
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-infrastructure -d
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-data-playground -d
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-design -d
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-internal-crm -d
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-private-notes -d
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-scripts -d
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-website -d
- run: /home/runner/.composer/vendor/bin/github-sync labels -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-wiki -d
- run: /home/runner/.composer/vendor/bin/github-sync milestones -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-ansible -s open
- run: /home/runner/.composer/vendor/bin/github-sync milestones -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-infrastructure -s open
- run: /home/runner/.composer/vendor/bin/github-sync milestones -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-data-playground -s open
- run: /home/runner/.composer/vendor/bin/github-sync milestones -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-design -s open
- run: /home/runner/.composer/vendor/bin/github-sync milestones -f mathesar-foundation/mathesar -t mathesar-foundation/mathesar-internal-crm -s open
Expand Down
30 changes: 27 additions & 3 deletions .github/workflows/test-and-lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ jobs:
needs.all_be_tests_required.outputs.tests_should_run
strategy:
matrix:
py-version: [3.9-bookworm, 3.10-bookworm, 3.11-bookworm, 3.12-bookworm]
pg-version: [13, 14, 15, 16]
py-version: [3.9-bookworm, 3.10-bookworm, 3.11-bookworm, 3.12-bookworm, 3.13-bookworm]
pg-version: [13, 14, 15, 16, 17]
steps:
- uses: actions/checkout@v4
- name: Copy env file
Expand All @@ -139,7 +139,7 @@ jobs:
needs.all_be_tests_required.outputs.tests_should_run
strategy:
matrix:
pg-version: [13, 14, 15, 16]
pg-version: [13, 14, 15, 16, 17]
steps:
- uses: actions/checkout@v4
- name: Copy env file
Expand All @@ -155,6 +155,30 @@ jobs:
- name: Run tests with pg_prove
run: docker exec mathesar_dev_db /bin/bash /sql/run_tests.sh

api_tests:
name: Run API scenario tests
runs-on: ubuntu-latest
needs: [python_tests_required, all_be_tests_required]
if: needs.python_tests_required.outputs.tests_should_run == 'true' ||
needs.all_be_tests_required.outputs.tests_should_run
strategy:
matrix:
py-version: [3.9-bookworm, 3.10-bookworm, 3.11-bookworm, 3.12-bookworm, 3.13-bookworm]
pg-version: [13, 14, 15, 16, 17]
steps:
- uses: actions/checkout@v4
- name: Copy env file
run: cp .env.example .env
# The code is checked out under uid 1001 - reset this to 1000 for the
# container to run tests successfully
- name: Fix permissions
run: sudo chown -R 1000:1000 .
- name: Run tests
run: sh run_api_tests.sh
env:
PYTHON_VERSION: ${{ matrix.py-version }}
PG_VERSION: ${{ matrix.pg-version }}

python_lint:
name: Run Python linter
runs-on: ubuntu-latest
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test Build
on: [pull_request, merge_group]
jobs:
build_tests:
name: Build mathesar
runs-on: ubuntu-latest
strategy:
matrix:
target: [production, development]
steps:
- uses: actions/checkout@v4
- name: Copy env file
run: cp .env.example .env
# The code is checked out under uid 1001 - reset this to 1000 for the
# container to run tests successfully
- name: Fix permissions
run: sudo chown -R 1000:1000 .
- name: Build the stack
run: docker compose -f docker-compose.dev.yml up --build -d test-service
env:
TARGET: ${{ matrix.target }}
63 changes: 25 additions & 38 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,26 @@ Before getting started with your code changes, read our [Contributor guide](./CO
## Loading sample data
For sample table data, you can create a new table in the UI using the `patents.csv` file found in `/mathesar/tests/data`.
- Using a CSV File (limited visibility of features):
For sample table data, you can create a new table in the UI using the `patents.csv` file found in `/mathesar/tests/data`.
- Using Mathesar Data Playground (recommended):
1. Clone the `mathesar-data-playground` repo:
```
git clone https://github.com/mathesar-foundation/mathesar-data-playground.git
```
2. Load the data from sql by running:
```
sudo docker exec -i mathesar_dev_db bash -c 'psql -U mathesar' < /path/to/your/cloned/repo/mathesar-data-playground/realistic_library_simulation/simulation_runs/simulation_run_20230106_00.sql
```
```
sudo docker exec -i mathesar_dev_db bash -c 'psql -U mathesar' < /path/to/your/cloned/repo/mathesar-data-playground/realistic_library_simulation/simulation_runs/simulation_run_20230106_00_checkouts.sql
```
3. [Sync]( https://docs.mathesar.org/user-guide/syncing-db/) these changes from the UI.
<!-- TODO add more content about sample data -->
Expand Down Expand Up @@ -168,6 +187,11 @@ Django uses gettext, which require the `.po` files to be compiled into a more ef
- To handle pluralization and other complexities, the source translation strings may utilize a special syntax called [JSON with ICU Plurals](https://help.transifex.com/en/articles/6220806-json-with-icu-plurals) (a subset of the [ICU format](https://unicode-org.github.io/icu/userguide/icu/i18n.html)).
- After making changes to your code, ensure that the source `/en/dict.json` file contains new translation strings, if any.
- Do not update other translation files. They will be pulled from our translation service provider when the translation process is complete.
- If you encounter merge conflicts in `en/dict.json`, run this script to automatically resolve them:
```
python3 mathesar_ui/scripts/i18n/resolve_dict_merge_conflicts.py
```
## Translation process
Expand Down Expand Up @@ -216,12 +240,6 @@ If you'd like to manually push or pull translations, follow the instructions in
1. Commit and push the changes to our repo.
## Demo mode
Mathesar can be run in "demo mode" to meet the specific needs of our [live demo site](https://demo.mathesar.org).
See our [Live demo mode](./demo/README.md) guide for more information on enabling live demo mode locally
## Opening a shell in the container
Expand All @@ -236,37 +254,6 @@ See our [Live demo mode](./demo/README.md) guide for more information on enablin
```
docker exec -it mathesar_dev_db psql -U mathesar
```
## Building Debian package
- On a Debian machine, install the following dependencies
```
sudo apt install debhelper-compat dh-virtualenv libsystemd-dev libpq-dev libicu-dev pkg-config lsb-release python3-dev python3 python3-setuptools python3-pip python3-venv tar
```
- Setup Mathesar build environment.
This step is useful only when testing locally is needed for building static files and for collecting them. We won't have a need for this step while using the build service as it will be using the source code from release assets which will contain these static files
- Install Python and Nodejs preferably on a Linux machine
- Run the following commands to set up the environment
```
python3 -m venv ./mathesar-venv
source ./mathesar-venv/bin/activate
pip install -r requirements.txt
sudo npm install -g npm-force-resolutions
cd mathesar_ui && npm install --unsafe-perm && npm run build
cd ..
python manage.py collectstatic
```
- From the mathesar directory, run the build script to generate the debian package
```
cd release-scripts && source build-debian.sh
```
## Troubleshooting
Expand Down
Loading

0 comments on commit a5328e9

Please sign in to comment.