Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOSS4G 2024 Belem workshop #244

Merged
merged 124 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
ba74abc
Update translation files
weblate May 14, 2022
5a0dc56
[admin] pump up version to 2.9.0
cvvergara Mar 13, 2023
c718a80
[admin] pump up version to 2.9.0
cvvergara Mar 13, 2023
ffd0eaf
Saving tentative values
cvvergara Apr 17, 2023
5a8ef08
fixing filename
cvvergara Apr 18, 2023
e0d18f7
Refining chapter1- introduction
cvvergara Apr 27, 2023
bf5a3c4
reorganizing chapter1 - introduction
cvvergara Apr 27, 2023
f1c56f7
updating OSGeoLive chapter
cvvergara Apr 27, 2023
b0fde67
Refining data chapter
cvvergara Apr 28, 2023
21b8b96
working out the images for pedestrian
cvvergara Apr 28, 2023
54b3109
[pedestrian] refining pedestrian chapter
cvvergara May 2, 2023
b4a846a
[pedestrian] refining pedestrian chapter
cvvergara May 2, 2023
b5bebd7
[pedestrian] refining pedestrian chapter
cvvergara May 2, 2023
55139f4
[vehicles] regining and creating views for images
cvvergara May 3, 2023
605b5e4
[sqlfn] refining build and creating fn for images
cvvergara May 3, 2023
d3a3753
udating images
cvvergara May 4, 2023
fb50fcd
refining sql chapter & adding images
cvvergara May 4, 2023
e361e96
refining chapter 8
cvvergara May 4, 2023
9656d75
[CI] updating actions
cvvergara May 4, 2023
7686e7e
Update locale: commit 9656d75f
github-actions[bot] May 8, 2023
0664523
adjustments & images to general-intro
cvvergara May 20, 2023
62b4b87
[Locale] updating the locale files
cvvergara May 20, 2023
d02cdde
[locale] updating the locale
cvvergara May 23, 2023
51125b2
[ja] adding Japanese locale
cvvergara May 23, 2023
2a5f81b
fixing typos
cvvergara May 29, 2023
3df37ce
fixing link
cvvergara May 29, 2023
d7d2eb6
Update locale: commit 3df37ce8
github-actions[bot] May 29, 2023
d40a129
(CI) fixing postgres version
cvvergara Mar 18, 2024
0203fe0
(CI) fixing postgres version
cvvergara Mar 18, 2024
edc5f63
removing -dev
cvvergara Mar 13, 2023
12e97b6
Workshop folder is 2.9 and not dev anymore
cvvergara Mar 18, 2024
31f55b4
Fixing typos on docs
cvvergara Mar 22, 2024
c1172da
(pot) updating the pot files
cvvergara Mar 22, 2024
b772915
(sp) adding spanish translation
cvvergara Mar 22, 2024
6ffdbd4
Removing obsolete entries
cvvergara Mar 22, 2024
1efe9ed
[admin] pump up version to 2.9.0
cvvergara Mar 13, 2023
ba82161
(build) fix conflict
cvvergara Mar 26, 2024
b193276
(es) removing unused directory
cvvergara Mar 30, 2024
d71b78a
(es) fixing ref links
cvvergara Mar 30, 2024
502d874
(es) updating ref on un-sdg chapters
cvvergara Mar 30, 2024
5c7a504
(build) Adjusting to Belem
cvvergara Sep 22, 2024
a421a43
(docs/general-intro) Refining
cvvergara Sep 22, 2024
e3a5303
(basic/pedestrian) Adjusting to Belem
cvvergara Sep 22, 2024
d537064
(basic/pedestrian) images update
cvvergara Sep 22, 2024
cd26443
(basic/vehicle) Adjusting to Belem
cvvergara Sep 22, 2024
892de1e
(basic/vehicle) images update
cvvergara Sep 22, 2024
47b87c9
(basic/sql_function) Adjusting to Belem
cvvergara Sep 22, 2024
bafdf48
(basic/sql_function) images update
cvvergara Sep 22, 2024
575bf06
(get data) Adjusting to Belem
cvvergara Sep 22, 2024
75eaadd
Adjusting appendix to changes on basic/pedestrian
cvvergara Sep 22, 2024
ce6638a
fixing some errors
cvvergara Sep 22, 2024
c941ea9
Update locale: commit ce6638ad
github-actions[bot] Sep 22, 2024
9c8680e
Refining pedestrian chapter
cvvergara Nov 3, 2024
10a44c3
Refining vehicle chapter
cvvergara Nov 3, 2024
cd1c362
Split sql_function.rst to have chapter with components
cvvergara Nov 3, 2024
496aeeb
Exercises to create vertices table
cvvergara Nov 3, 2024
c65517f
(graph-views) refining new chapter
cvvergara Nov 3, 2024
b031b72
(pedestrian) using collapse to show results
cvvergara Nov 3, 2024
013f71d
Refining sql function chapter
cvvergara Nov 4, 2024
d8d7ba7
(basic) appendix no longer needed to show solutions
cvvergara Nov 5, 2024
4c1f712
(basic) refining plpgsql_function chapter
cvvergara Nov 5, 2024
6ae7452
(build) setting points
cvvergara Nov 5, 2024
0a34eff
(build) removing appendix
cvvergara Nov 5, 2024
2b2e9a1
fixing spelling
cvvergara Nov 5, 2024
26c3534
(build) adding the extension sphinx-collapse
cvvergara Nov 5, 2024
794548e
Merge pull request #231 from cvvergara/belem-2024-basic-part1
cvvergara Nov 5, 2024
b2cfaa9
Update locale: commit 794548e6
github-actions[bot] Nov 5, 2024
cbd8403
Removing unused locale file for basic/appendix
cvvergara Nov 5, 2024
7811e0b
Merge pull request #232 from cvvergara/remove-unused-locale-files
cvvergara Nov 5, 2024
b2f3801
(pot,en) Updating locale
cvvergara Nov 5, 2024
62b6a96
(locale/es) marking string that need translation
cvvergara Nov 5, 2024
8c4dd88
(locale/ja) Marking string that needs revision on translation
cvvergara Nov 5, 2024
a0a69fd
(locale/es) Marking string that needs revision on translation
cvvergara Nov 5, 2024
f9b462c
Fixing the build
cvvergara Nov 5, 2024
85f8812
fix a typo
cvvergara Nov 5, 2024
6d869ad
Merge pull request #233 from cvvergara/locale-mark-changes-for-revison
cvvergara Nov 5, 2024
3551f97
Update locale: commit 6d869ada
github-actions[bot] Nov 5, 2024
6d034f5
Translated using Weblate (Spanish)
cvvergara Nov 5, 2024
2f6b438
Merge pull request #234 from osgeoweblate/weblate-pgrouting-workshop-…
cvvergara Nov 5, 2024
019265a
fixing some typos
cvvergara Nov 5, 2024
134a0cc
sdg3-health refining chapter
cvvergara Nov 7, 2024
28d49ae
reclasification of chapter-12
cvvergara Nov 7, 2024
61a8297
Adding erosion and fixing typos
cvvergara Nov 7, 2024
d60cd81
Using bootstrap 2 to remove index on left side
cvvergara Nov 7, 2024
5f0c4d6
Refining sdg7-energy chapter
cvvergara Nov 7, 2024
8878899
Refining Readme
cvvergara Nov 7, 2024
8de687b
Merge pull request #235 from cvvergara/refining-un-chapters
cvvergara Nov 7, 2024
c962866
Update locale: commit 8de687be
github-actions[bot] Nov 7, 2024
1b08a15
Update locale
cvvergara Nov 7, 2024
4e20d5f
Merge pull request #236 from cvvergara/update-locale
cvvergara Nov 7, 2024
22466c8
UN appendix not used anymore
cvvergara Nov 7, 2024
8af724e
Refining sdg11-cities chapter
cvvergara Nov 7, 2024
263dcc2
Add an action to update the locale
cvvergara Nov 7, 2024
2aeaed5
Only updating website on action
cvvergara Nov 7, 2024
67d9bbe
Merge pull request #237 from cvvergara/refining-sdg11-chapter
cvvergara Nov 9, 2024
dfc7f60
Removing appendix from locale
cvvergara Nov 9, 2024
4b633b8
(locale) Adjusting line numbers
cvvergara Nov 9, 2024
9f93c2e
(build,CI) adjusting the requirements and build options
cvvergara Nov 9, 2024
002251e
Merge pull request #238 from cvvergara/remove-appendix-from-locale
cvvergara Nov 9, 2024
371c5d8
Minor fixes on problems detected while translating
cvvergara Nov 10, 2024
4c9c105
Update locale: commit 371c5d82
github-actions[bot] Nov 10, 2024
cd27db0
Merge pull request #240 from cvvergara/minor-fixes-1
cvvergara Nov 10, 2024
8fa2355
Translated using Weblate (Spanish)
cvvergara Nov 10, 2024
5c43dfd
Translated using Weblate (Japanese)
weblate Nov 10, 2024
52ffce4
Merge pull request #239 from osgeoweblate/weblate-pgrouting-workshop-…
cvvergara Nov 10, 2024
b37aaf7
fixing Project-Id-Version on locale files
cvvergara Dec 16, 2024
d4c878b
fixing links of sponsors
cvvergara Dec 16, 2024
5605150
Fixing some other links
cvvergara Dec 16, 2024
310de96
Remove translation of file no longer on the repo
cvvergara Dec 16, 2024
f98a5ad
Removing trailing and double space
cvvergara Dec 16, 2024
2cf087c
(build) adding ja to the build and fix indentation
cvvergara Dec 16, 2024
6e6ca33
Refining scripts/update_locale.sh
cvvergara Dec 16, 2024
6f44136
Update locale: commit 6e6ca33b
github-actions[bot] Dec 16, 2024
ee5b1b7
Merge pull request #242 from cvvergara/fix-links-and-locale-update
cvvergara Dec 16, 2024
0c7e1ad
Update sql_function.rst
cvvergara Dec 16, 2024
b57dd46
Update sql_function.rst
cvvergara Dec 16, 2024
13ac402
Update locale: commit 0c7e1ad2
github-actions[bot] Dec 16, 2024
c247f3f
Update locale: commit b57dd46e
github-actions[bot] Dec 16, 2024
e2fb745
Merge branch 'develop' into cvvergara-patch-1
cvvergara Jan 24, 2025
1a42720
Merge pull request #243 from pgRouting/cvvergara-patch-1
cvvergara Jan 24, 2025
09df2c6
Translated using Weblate (Spanish)
cvvergara Dec 16, 2024
93a6f7c
Update locale: commit 09df2c60
github-actions[bot] Jan 24, 2025
08cc4bf
Merge pull request #241 from osgeoweblate/weblate-pgrouting-workshop-…
cvvergara Jan 24, 2025
4944bc0
Merge branch 'main' into develop
cvvergara Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ------------------------------------------------------------------------------

# For all the chapter files
for file in $(find locale/en -type f -name "*.po"); do
for file in $(find locale -type f -name "*.po"); do
if grep -q '#~' $file; then
perl -pi -0777 -e 's/#~.*//s' $file
git add $file
Expand Down
48 changes: 48 additions & 0 deletions .github/scripts/update_locale.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
# ------------------------------------------------------------------------------
# /*PGR-GNU*****************************************************************
# File: update_locale.sh
# Copyright (c) 2021 pgRouting developers
# Mail: project@pgrouting.org
# ------
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# ********************************************************************PGR-GNU*/
# ------------------------------------------------------------------------------

DIR=$(git rev-parse --show-toplevel)

pushd "${DIR}" > /dev/null || exit 1

mkdir -p build
pushd build > /dev/null || exit 1
cmake -DLOCALE=ON ..

make locale
popd > /dev/null || exit 1
Comment on lines +24 to +31
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for CMake configuration and build steps.

The script should check the return status of critical operations.

 pushd "${DIR}" > /dev/null || exit 1
 
 mkdir -p build
 pushd build > /dev/null || exit 1
-cmake -DLOCALE=ON ..
+cmake -DLOCALE=ON .. || { echo "CMake configuration failed"; exit 1; }
 
-make locale
+make locale || { echo "make locale failed"; exit 1; }
 popd > /dev/null || exit 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pushd "${DIR}" > /dev/null || exit 1
mkdir -p build
pushd build > /dev/null || exit 1
cmake -DLOCALE=ON ..
make locale
popd > /dev/null || exit 1
pushd "${DIR}" > /dev/null || exit 1
mkdir -p build
pushd build > /dev/null || exit 1
cmake -DLOCALE=ON .. || { echo "CMake configuration failed"; exit 1; }
make locale || { echo "make locale failed"; exit 1; }
popd > /dev/null || exit 1


# List all the files that needs to be committed in build/docs/locale_changes.txt
awk '/^Update|^Create/{print $2}' build/docs/locale_changes.txt > build/docs/locale_changes_po.txt # .po files
cp build/docs/locale_changes_po.txt build/docs/locale_changes_po_pot.txt
perl -ne '/\/en\// && print' build/docs/locale_changes_po.txt | \
perl -pe 's/(.*)en\/LC_MESSAGES(.*)/$1pot$2t/' >> build/docs/locale_changes_po_pot.txt # .pot files

# Do not create empty translation files
git status locale/es --porcelain | awk 'match($1, "?"){print $2}' | xargs -r rm -rf
git status locale/ja --porcelain | awk 'match($1, "?"){print $2}' | xargs -r rm -rf

# Remove obsolete entries #~ from .po files
bash .github/scripts/remove_obsolete_entries.sh

cat build/docs/locale_changes_po_pot.txt | xargs -I {} sh -c "(ls {} >> /dev/null 2>&1 && git add {} )"

popd > /dev/null || exit 1
98 changes: 98 additions & 0 deletions .github/workflows/locale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Update Locale

# This action runs:
# - When this file changes
# - When changes on documentation (doc)
# - When is triggered manually

on:
workflow_dispatch:
push:

permissions:
contents: write

jobs:
update-locale:
name: Update Locale
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get postgres version
run: |
sudo service postgresql start
pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
echo "PGVER=${pgver}" >> $GITHUB_ENV
echo "PGIS=3" >> $GITHUB_ENV
Comment on lines +30 to +34
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix shell script quoting issues.

The script has potential word splitting issues due to unquoted variables.

Apply these fixes:

-          pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
-          echo "PGVER=${pgver}" >> $GITHUB_ENV
+          pgver="$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')"
+          echo "PGVER=${pgver}" >> "$GITHUB_ENV"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: |
sudo service postgresql start
pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
echo "PGVER=${pgver}" >> $GITHUB_ENV
echo "PGIS=3" >> $GITHUB_ENV
run: |
sudo service postgresql start
pgver="$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')"
echo "PGVER=${pgver}" >> "$GITHUB_ENV"
echo "PGIS=3" >> $GITHUB_ENV
🧰 Tools
🪛 actionlint (1.7.4)

30-30: shellcheck reported issue in this script: SC2086:info:3:26: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:4:18: Double quote to prevent globbing and word splitting

(shellcheck)


- name: Extract branch name and commit hash
run: |
branch=${GITHUB_REF#refs/heads/}
git_hash=$(git rev-parse --short "$GITHUB_SHA")
echo "GIT_HASH=$git_hash" >> $GITHUB_ENV

- name: Add PostgreSQL APT repository
run: |
sudo apt-get install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ \
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y osm2pgrouting \
postgresql-${PGVER}-postgis-${PGIS} \
postgresql-${PGVER}-postgis-${PGIS}-scripts \
postgresql-${PGVER}-pgrouting

python -m pip install --upgrade pip
pip install -r REQUIREMENTS.txt
pip list

- name: Configure
run: |
service postgresql status
sudo service postgresql start
service postgresql status
sudo -u postgres createdb -p ${POSTGRES_PORT} setup
sudo -u postgres psql -c 'CREATE ROLE "runner" SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD $$runner$$;' -d setup
echo :5432:*:runner:runner >> .pgpass
sudo -u postgres psql -c 'CREATE ROLE "user" SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD $$user$$;' -d setup
echo :5432:*:user:user >> .pgpass
Comment on lines +71 to +75
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance PostgreSQL security configuration.

The PostgreSQL setup uses hardcoded passwords and superuser privileges, which is not recommended for security.

Consider:

  1. Using environment variables for passwords
  2. Limiting user privileges to only what's necessary
  3. Using connection pooling for better security

Example:

-          sudo -u postgres psql -c 'CREATE ROLE "runner" SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD $$runner$$;' -d setup
+          sudo -u postgres psql -c "CREATE ROLE \"runner\" LOGIN PASSWORD '${RUNNER_PASSWORD}' INHERIT;" -d setup
+          sudo -u postgres psql -c "GRANT CONNECT ON DATABASE setup TO runner;" -d setup

Committable suggestion skipped: line range outside the PR's diff.

mkdir build
cd build
cmake -DLOCALE=ON ..
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: setup

- name: Initialize mandatory git config
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Update locale
run: |
bash .github/scripts/update_locale.sh

# Add the files, commit and push
git diff --staged --quiet || git commit -m "Update locale: commit ${{ env.GIT_HASH }}"
git restore . # Remove the unstaged changes before rebasing
git push
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get postgres version
run: |
Expand All @@ -28,7 +28,7 @@ jobs:
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

- name: Install python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Update Locale and Website
name: Update Website

on:
workflow_dispatch:
push:
branches:
- develop
- un-challenge
- main

jobs:
update-documentation:
name: Update Locale and Website
name: Update Website
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

- name: Install python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
echo :5432:*:user:user >> .pgpass
mkdir build
cd build
cmake -DLOCALE=ON -DPGR_WORKSHOP=ON -DES=ON ..
cmake -DES=ON ..
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
Expand All @@ -90,25 +90,6 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Update locale
if: github.ref == 'refs/heads/develop'
run: |
# List all the files that needs to be committed in build/docs/locale_changes.txt
awk '/^Update|^Create/{print $2}' build/docs/locale_changes.txt > tmp && mv tmp build/docs/locale_changes.txt # .po files
cat build/docs/locale_changes.txt | perl -pe 's/(.*)en\/LC_MESSAGES(.*)/$1pot$2t/' >> build/docs/locale_changes.txt # .pot files
cat build/docs/locale_changes.txt

# Remove obsolete entries #~ from .po files
tools/transifex/remove_obsolete_entries.sh

# Add the files, commit and push
for line in `cat build/docs/locale_changes.txt`; do git add "$line"; done
git diff --staged --quiet || git commit -m "Update locale: commit ${{ env.GIT_HASH }}"
git fetch origin develop
git restore . # Remove the unstaged changes before rebasing
git rebase origin/develop
git push origin develop

- name: Update Website
run: |
if [[ "${{ env.BRANCH }}" == "develop" ]]; then
Expand Down
Loading
Loading