Conversation
Add .plans/, .env, and src/pgstacrust/target/ to .gitignore. Local planning files are working notes only and must not be committed. The .env file holds local secret/port overrides from .env.example.
…ipts/ docker/pypgstac/bin/ contained scripts that run inside the pypgstac container. Move them to scripts/container-scripts/ to make the layout explicit: scripts/ is the host-facing entrypoint surface, scripts/container-scripts/ is the in-container payload. The Dockerfiles are updated in the next commit to COPY from the new path. A new scripts/makemigration host wrapper is added for the in-container makemigration helper.
…var support
All host-facing scripts (test, format, migrate, server, stageversion,
runinpypgstac, console) now:
- Accept --help / -h
- Honor PGSTAC_BUILD_POLICY={always,missing,never} (replaces bare --build)
- Honor PGSTAC_FAST, PGSTAC_WATCH, PGSTAC_STRICT where applicable
scripts/test expanded from a 3-line wrapper to a full-featured runner
with --fast, --watch, --build-policy, --no-strict, and stale-image
detection (refuses to run with build-policy!=always when scripts/docker/src
have uncommitted changes).
scripts/pgstacenv gains:
- ensure_env_file: auto-creates .env from .env.example on first run
- first_available_pgport: scans 5439-5445 to avoid port conflicts
.env.example documents all supported variables.
Closes #339 — PL/Rust support removed: - pgstacbase-plrust and pgstac-plrust Docker targets deleted - docker-entrypoint.sh, pgstac-rust-preinit.sh, pgstac-rust.sh deleted Closes #231 — base images updated from bullseye to trixie: - postgres:${PG_MAJOR}-trixie for pgstacbase - rust:1-slim-trixie for pyrustbase Other changes: - pg_tle v1.5.2 built from source in pgstacbase; database init creates the extension automatically - All RUN layers use BuildKit cache mounts (apt, uv, git) to speed rebuilds - New pypgstac-runtime target: slim python:3.13-trixie image without Rust toolchain for production deployments - docker-compose.yml: env_file .env, explicit PGHOST/PGPORT defaults, pgstac healthcheck, service_healthy dependency on pypgstac service - container_name entries removed to allow concurrent local instances - Dockerfiles use syntax=docker/dockerfile:1.7 directive
…abot expansion Closes #334 — PostgreSQL 16, 17, and 18-beta added to CI and Docker build matrix via strategy.matrix.pg_major: [16, 17, 18]. Closes #202 — daily scheduled CI run (cron: '23 4 * * *') rebuilds images and runs all tests, catching upstream base-image CVEs. Other CI changes: - workflow_dispatch trigger added for on-demand manual runs - dorny/paths-filter v2 -> v3 - docker/build-push-action v4 -> v6 - astral-sh/setup-uv v8.0.0 -> v8.1.0 - All action SHA pins refreshed - CI now invokes scripts/container-scripts/test directly instead of relying on the old docker/pypgstac/bin/ PATH entry Dependabot expanded: - New docker ecosystem for base-image updates (docker-base-images group) - New pip ecosystem for src/pypgstac (python-dev-tooling and python-runtime groups) - actions group renamed from minor-and-patch to actions-all
…-hooks to v5 Remove flake8, black, and mypy from dev dependencies. Replace with: - ruff==0.15.11 (lint + format, supersedes both flake8 and black) - ty==0.0.31 (type checking, supersedes mypy) Also: - pre-commit pinned to 3.5.0 (>=4.0 requires Python >=3.10) - pre-commit-hooks updated from v4.4.0 to v5.0.0 - ruff file pattern tightened to ^src/pypgstac/(src/pypgstac|tests)/.*\.py$ - Remove [tool.mypy] section from pyproject.toml (ty reads pyproject.toml natively) - Update comment referencing black to 'handled by formatter' Note: pytest, morecantile, types-cachetools, and other packages with requires-python >=3.9/3.10 are intentionally held at their current pins until the Python floor is raised in a later PR.
datetime.min and datetime.max are naive (no tzinfo). When compared with offset-aware datetimes returned by psycopg, Python raises: TypeError: can't compare offset-naive and offset-aware datetimes Introduce module-level constants: MIN_DATETIME_UTC = datetime.min.replace(tzinfo=timezone.utc) MAX_DATETIME_UTC = datetime.max.replace(tzinfo=timezone.utc) and use them as the fallback values in _partition_update() where datetime_range_min/max and end_datetime_range_min/max are computed.
…ayout CONTRIBUTING.md: - Remove outdated reference to local pypgstac install requirement - Add note about .plans/ being gitignored and .env.example workflow - Document pre-commit setup via uv tool install - Document --fast, --build-policy, and PGSTAC_BUILD_POLICY options - Clarify scripts/container-scripts/ vs scripts/ split - Add scripts/makemigration --from / --to example - Fix missing newline at end of file CLAUDE.md: - Update Architecture section: scripts/ and scripts/container-scripts/ replace the old docker/pypgstac/bin/ reference - Update pgstac_restore path reference - Update makemigration path reference - Change --formatting description from 'ruff + mypy' to 'ruff + ty' .github/instructions/scripts.instructions.md: - Add note that scripts/container-scripts/ is the in-container payload and host wrappers stay in scripts/
…nges Documents all changes relative to v0.9.11 (main branch): - Added: container-scripts dir, makemigration wrapper, .env.example, --help on all scripts, env-var script options, daily CI schedule, pg_major matrix (16/17/18), workflow_dispatch, pg_tle in base image, pypgstac-runtime Docker target, expanded Dependabot coverage - Changed: scripts moved from docker/pypgstac/bin, bullseye->trixie bases, BuildKit caches, docker-compose healthchecks, runinpypgstac --build-policy, flake8/black/mypy->ruff+ty, action pin updates, Dependabot group rework - Removed: PL/Rust targets, docker-entrypoint/pgstac-rust-* scripts, docker/pypgstac/bin/, flake8/black/mypy - Fixed: timezone-aware MIN/MAX_DATETIME_UTC in loader Adds [Unreleased] link reference pointing to v0.9.11...HEAD. docs/src/release-notes.md is a symlink to CHANGELOG.md and stays in sync.
Switch the CI schedule from daily to weekly: - cron: '23 4 * * 0' This keeps periodic base-image refresh coverage while reducing scheduler churn and CI load.
- Raise package floor to Python >=3.11 and advertise 3.11-3.14 - Move settings to pydantic-settings; require pydantic>=2,<3 - Remove cachetools upper bound and relax types-cachetools pin - Set Ruff target-version/line-length and simplify active lint rule set - Make formatting pipeline single-source via scripts/test --formatting by removing duplicate direct Ruff pre-commit hooks - Run ty via project config (ty check) in scripts/container-scripts/test
Generated via stageversion in unreleased mode: - pgstac.sql assembled from sql source - base migration: pgstac.unreleased.sql - incremental migration: pgstac.0.9.11-unreleased.sql - sql/999_version.sql set to unreleased - pypgstac runtime version set to 0.9.11-dev
- Restore proper v0.9.11 section boundary - Add explicit issue-closing references for closed items - Update CI schedule note from daily to weekly - Document pypgstac modernization (Python 3.11 floor, pydantic-settings migration, cachetools bound policy) - Note Ruff/ty and pre-commit formatting pipeline alignment
- default runinpypgstac build policy to always and make mutating wrappers use cpfiles by default\n- fix pypgstac container prerequisites (uv system install + adduser) and refresh collation versions in test setup\n- keep substantive ty-driven fixes while minimizing unclear type-only patterns\n- align tests and fixtures with stricter typing and current loader method enums\n\nValidated with scripts/runinpypgstac --build-policy always test --formatting and scripts/runinpypgstac --build-policy never test --pypgstac.
|
@copilot can you fix the issues with ci? |
Agent-Logs-Url: https://github.com/stac-utils/pgstac/sessions/e7442dd4-51ba-4edc-9c8d-c7e2ac412ea6 Co-authored-by: bitner <164828+bitner@users.noreply.github.com>
Fixed in 610df99. I investigated the failed CI run and patched Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: bitner <164828+bitner@users.noreply.github.com>
|
@copilot CI is still not working. Can you make sure that everything on CI will pass before making another commit and fix things so that it all goes through? Don't just knock things down one at a time. Please make sure that CI will be all green when you make your fixes. |
Agent-Logs-Url: https://github.com/stac-utils/pgstac/sessions/c170270d-8561-4174-9d19-c0515f159b30 Co-authored-by: bitner <164828+bitner@users.noreply.github.com>
Fixed in 9d6e3ea. I investigated the failing CI runs and addressed the common root cause in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot come on. ci still isn't passing. make sure to not just look at the last error you got, but look overall at the code and ci settings to make sure you fix everything that might trip up ci. |
Agent-Logs-Url: https://github.com/stac-utils/pgstac/sessions/60dc83e2-07bd-4fca-bc6b-eb2289666e95 Co-authored-by: bitner <164828+bitner@users.noreply.github.com>
Fixed in 3f55b51. I re-triaged the whole CI matrix and logs and addressed the remaining shared blocker in the lowest-direct jobs: typing compatibility against lower-bound dependencies. Specifically, I removed the |
hrodmn
left a comment
There was a problem hiding this comment.
Thanks for adding the script helpers and for the updated CONTRIBUTING.md! The extra context is nice.
It's just a nit but since we are onto Python 3.11+ and we are doing these chores I think we could eliminate some of the typing classes and just use the bare classes e.g. Dict -> dict as well as replacing Optional[str] with str | None.
The rest of the changes seem fine but I want to understand why we have a migration file with any actual changes in it!
| python-runtime: | ||
| applies-to: version-updates | ||
| patterns: | ||
| - "cachetools" | ||
| - "fire" | ||
| - "hydraters" | ||
| - "orjson" | ||
| - "plpygis" | ||
| - "pydantic" | ||
| - "python-dateutil" | ||
| - "smart-open" | ||
| - "tenacity" | ||
| - "version-parser" | ||
| - "psycopg*" |
There was a problem hiding this comment.
will we need to update this list with new dependencies as they get added to pyproject.toml?
| "Help" | ||
| exit 2 | ||
| cat <<EOF | ||
| Usage: $(basename "$0") -f VERSION -t VERSION [options] |
|
|
||
| Options: | ||
| --fast Run formatting plus non-migration test suites. | ||
| --watch Re-run tests when files change. |
There was a problem hiding this comment.
I didn't think any actual SQL changed - is this just a placeholder now that we are pushing changes beyond the latest release (0.9.11)?
There was a problem hiding this comment.
this is a noop sql change (only the idempotent sql files are getting run). We want to have an unreleased version here so that it can go through all the motions with the scripts and testing.
Co-authored-by: Henry Rodman <henry.rodman@gmail.com>
Co-authored-by: Henry Rodman <henry.rodman@gmail.com>
House cleaning for pgstac scripts and docker setup prior to substantive work towards the breaking v0.10.0 release. Work towards v0.10.0 will encompass several PRs prior to kicking out a release to try to keep the scope of PRs more manageable.
Primary Bullet Points for this PR:
Added
scripts/makemigrationhost wrapper for the in-containermakemigrationhelper..env.exampledocumenting all supported environment variables for local development.test,format,migrate,server,stageversion,runinpypgstac,console) now accept--help/-hand honor environment-variablecounterparts for common flags (
PGSTAC_BUILD_POLICY,PGSTAC_FAST,PGSTAC_WATCH,PGSTAC_STRICT).scripts/pgstacenvgainsensure_env_file(auto-creates.envfrom.env.exampleon first run) and
first_available_pgport(avoids port collisions on shared machines).scripts/testexpanded from a 3-line wrapper to a full-featured test runner supporting--fast,--watch,--build-policy,--no-strict, and stale-image detection.cron: '23 4 * * 0') to catch upstream base-image CVEs withoutrequiring a code change. (Closes New pgstac image to remediate CVE-2023-39417 and other CVEs associated with postgres 15.3 and older versions #202)
workflow_dispatchtrigger for manual CI runs.pg_tlev1.5.2 built and pre-loaded in thepgstacbaseimage; database init runsCREATE EXTENSION IF NOT EXISTS pg_tle.pypgstac-runtimeDocker target: slim Python 3.13-trixie image without the Rust/buildtoolchain, for production deployments where the Rust build environment is not needed.
ecosystems with grouped update policies).
Changed
docker/pypgstac/bin/toscripts/container-scripts/; containerPATHupdated accordingly.docker/pgstac/Dockerfileanddocker/pypgstac/Dockerfilebase images updated frombullseyetotrixie. (Closes scripts/install missing? #231)RUNlayers now use BuildKit cache mounts for apt, uv, and git caches,significantly reducing incremental rebuild times.
docker-compose.yml: addsenv_file: .env, explicitPGHOST/PGPORTdefaults,a pgstac healthcheck, and a
service_healthydependency on pypgstac.runinpypgstacgains--build-policy {always,missing,never}replacing the bare--buildflag;PGSTAC_BUILD_POLICYenv var provides a persistent default.flake8,black, andmypyremoved in favour ofruff==0.15.11andty==0.0.31.pre-commitpinned to3.5.0.pre-commit-hooksupdated to v5.0.0.pypgstacpackage floor raised to Python 3.11; metadata now advertises 3.11-3.14.pypgstacsettings now usepydantic-settings(BaseSettingsfrompydantic_settings) and requirepydantic>=2,<3.cachetoolsupper bound removed (cachetools>=5.3.0) sincepypgstaconly usescachetools.func.lru_cache; no known incompatible API changes affect this usage.pypgstacdeveloper tooling config now consistently targets Ruff + ty:removes stale mypy config, pins Ruff to
0.15.11to match pre-commit,and adds minimal
[tool.ty]project settings.scripts/test --formattingas thesingle pre-commit entry point (removing duplicate direct Ruff pre-commit hooks)
and aligns Ruff line-length handling with the formatter (
E501ignored;explicit
line-length = 88).dorny/paths-filterv2→v3,docker/build-push-actionv4→v6,
astral-sh/setup-uvv8.0.0→v8.1.0; all SHA pins refreshed.actions-all(replacesminor-and-patch), newdocker-base-images,python-dev-tooling, andpython-runtimegroups.docker-compose.ymlremoves explicitcontainer_nameentries to avoid conflictsbetween concurrent local instances.
Removed
pgstacbase-plrustandpgstac-plrustDocker targets removed; thepgstac image no longer builds or ships PL/Rust or the Rust toolchain. (Closes Remove PL/Rust Docker Target #339)
flake8,black, andmypyremoved from dev dependencies.Fixed
load.py: Use timezone-awareMIN_DATETIME_UTC/MAX_DATETIME_UTCsentinelconstants (instead of naive
datetime.min/datetime.max) to avoidTypeError: can't compare offset-naive and offset-aware datetimes.