Repository navigation
Publish Preset build 1.1.11.1 to the internal package index (do not merge until Jenkins onboarding) - #2
Conversation
635d9ba to
43dc1d8
Compare
|
Re-based this onto I had originally branched it from Stacking on #1 is also just the right shape: the publication path should sit on top of the code it publishes. Now green — 11/11 checks including CodeQL. |
43dc1d8 to
a9c2f98
Compare
|
Reviewer notes on who I tagged and why:
I could not request review from @craig-rueda or @maxim-preset — they authored/last touched Two things I deliberately did not decide:
|
a9c2f98 to
6d87d7b
Compare
|
Updated for the wheel-only decision. Summary of what changed and two things reviewers should push back on if I got them wrong: Wheel-only publish, but still a two-artifact build. Stable only from merged history. Immutability is now atomic. Dropped One prerequisite I cannot verify from here: Reproducibility. The build now pins The SHA256 for Shell is captured by re-downloading the artifact actually being served, digesting that, and failing if it differs from what was built. It's archived as CI: 10/10 green. CodeQL doesn't run here because |
Publishes the Preset build of this fork to the internal package index through Jenkins, following the existing Preset publishers (claude-commands, service-lib-py, api-clients). Jenkins binds the 'ci-user' AWS credential at runtime; no credential material is stored in the repo. Every index operation goes through the AWS API against the backing bucket rather than the index's public HTTP front door. That keeps the deployment hostname out of this repository, and it is also the more correct check: the bucket is authoritative and is not subject to caching in front of the index. Publishes the pure-Python wheel only. The sdist is still built, because tools/check_dist.py validates the wheel and sdist as a pair and that gate is worth keeping intact, but it is never uploaded: the wheel is byte-identical across rebuilds once SOURCE_DATE_EPOCH is pinned to the commit, whereas the sdist is not reproducible even with it. Only an artifact that can be rebuilt and compared is fit for a consumer to pin. Adopts the four-component convention already present in the bucket (upstream PyHive 0.7.0 -> Preset 0.7.0.1/0.7.0.2), so the Preset build of upstream 1.1.11 is declared as 1.1.11.1 in sqlalchemy_drill/__init__.py. A stable version is published only from master, i.e. only from reviewed and merged history. PR builds publish 1.1.11.1+PR-<n>.<shortsha>, and the build asserts that a non-master branch can never emit the bare stable version rather than leaving it to convention. Uploads are immutable. 'aws s3 sync' is not used, because it replaces an object whose content changed; the upload is an 'aws s3api put-object --if-none-match *', which S3 rejects with 412 if the key exists, so the no-overwrite guarantee is atomic instead of a check-then-write race. After upload the stored object is read back and digested, and the build fails if it differs from what was built. That digest is archived and is the value a consumer pins. The existence check uses the real artifact name. setuptools emits the underscored distribution name (sqlalchemy_drill-<version>...) while the bucket prefix and Shell requirement use the dashed project name, so LIB_NAME and DIST_NAME are separate; conflating them would have made the check probe a key that never exists and silently permit an overwrite.
6d87d7b to
7b67e4c
Compare
Purpose
Publishes the Preset build of this fork to the internal package index (S3-backed,
s3://preset-pypi).Stacked on #1, which stays byte-identical to the reviewed upstream #100 head (
ca7ace9e). This PR adds exactly two things on top: theJenkinsfileand the version bump.Do not merge until #1 and #2 are reviewed and Jenkins multibranch onboarding is done. Nothing has been published, tagged, or uploaded.
Version:
1.1.11.1Adopts the four-component convention already established in this bucket by PyHive — upstream
0.7.0became Presetpyhive-0.7.0.1and0.7.0.2. The Preset build of upstream1.1.11is therefore1.1.11.1, declared explicitly insqlalchemy_drill/__init__.pyso the published version is auditable in git rather than synthesised during the build.1.1.11.1sorts above a hypothetical upstream1.1.11and below1.1.12. That is precisely why it is consumed only via an immutable direct artifact URL and never offered to a resolver as a candidate for the plainsqlalchemy-drillname — a future upstream release stays free to win.One residual worth naming: the bucket is a flat index, so an object placed in it is visible to anyone who points a resolver at the host. Direct-URL pinning protects Shell, but it does not by itself stop a third party from resolving
1.1.11.1if they add this host as an index. The protection is the consumption pattern, not the bucket.Publishing mechanism
Not a Warehouse/devpi/Nexus instance — a flat S3 bucket behind nginx (
/simple/404s). There is no trusted-publishing (OIDC / PEP 740) path available, because there is no index to establish a trusted publisher against. Publication iss3:PutObject.This follows the existing Preset publishers (
claude-commands,service-lib-py,api-clients,superset-s3-audit, …): Jenkins binds the existingci-usercredential at runtime viaAmazonWebServicesCredentialsBindingand runsaws s3 sync ./dist s3://preset-pypi. The IAM grant is already inpreset-io/infra(pypi-s3.tf):ci_userholdss3:*onarn:aws:s3:::preset-pypi. No credential material is in this repo — only variable names.Two fixes to the inherited pattern
claude-commandschecks${LIB_NAME}-${version}.tar.gz, i.e.sqlalchemy-drill-1.1.11.1.tar.gz. setuptools actually emits the underscored distribution name,sqlalchemy_drill-1.1.11.1.tar.gz. The guard would have requested a path that never exists, always 404'd, and silently permitted an overwrite of a published artifact.LIB_NAME(bucket folder / requirement name) andDIST_NAME(artifact filename) are now separate.Artifact validation
Built from this exact tree at
1.1.11.1:sqlalchemy_drill-1.1.11.1-py3-none-any.whl,sqlalchemy_drill-1.1.11.1.tar.gz1.1.11.1= sdist1.1.11.1=__init__.py1.1.11.1twine check --stricttools/check_dist.py['sqlalchemy_drill']only, notestpackage; sdist has all 20 required pathsMetadata-Version: 2.4,License: MIT, wheel tagpy3-none-any,Root-Is-Purelib: trueHome-pageand original author list retainedWheel only — and why
Decision: publish and consume the pure-Python wheel. The sdist is not published.
Two builds of identical source produced different hashes. Investigating:
SOURCE_DATE_EPOCHis pinned — verified identical sha256 across rebuilds.SOURCE_DATE_EPOCH(setuptools bakes in member ordering and mtimes).Only an artifact that can be rebuilt and compared against what is being served is fit for a consumer to pin, so only the wheel is uploaded. The wheel is also pure-python (
py3-none-any), so a direct-URL consumer installs it with no build step.The sdist is still built, deliberately:
tools/check_dist.pyvalidates the wheel and sdist as a pair, and that gate is worth keeping intact. It is simply never uploaded. Publishing and building are separate concerns here.The build pins
SOURCE_DATE_EPOCHto the commit timestamp, so the published wheel is reproducible from its exact revision.Stable releases come only from merged history
master→ stable1.1.11.1. Only reviewed, merged Preset history produces a stable version.1.1.11.1+PR-<n>.<shortsha>, a PEP 440 local version that is explicitly not a stable release.This is asserted in the build, not left to convention: a non-
masterbranch that would emit the bare stable version fails the job, and a PR build that somehow produced a non-local version fails too.Immutability is atomic, not best-effort
aws s3 syncis not used — it replaces an object whose content changed. The upload is:S3 rejects that with 412 if the key already exists, so a published artifact can never be replaced. That closes the check-then-write race a
curl -Iguard alone leaves open (the readable pre-flight check is kept, but only as a fast, clear failure).The SHA256 Shell should pin
After upload the job re-downloads the artifact actually being served, digests that, and fails if it differs from what was built. That digest is printed in the log and archived as
published.sha256(fingerprinted).That archived value — not any locally computed one — is what Shell pins.
CI
10/10 checks green. CodeQL does not appear on this PR, and that is expected rather than missing:
codeql.ymlis scoped topull_request: branches: [master], and this PR targets theworkflow-a-…branch. CodeQL passed on #1 against the same code content.Shell integration plan (for a follow-up PR in
preset-io/superset-shell— not done here)Current state:
requirements.txt:1480pinssqlalchemy-drill==1.1.2from public PyPI, andconfig/sqlalchemy-driver-manifest.json→connectors[11]recordslocked_version: "1.1.2",status: "upgrade-required", with a note that the deployed version predates SQLAlchemy 2import_dbapisupport.requirements.txtis autogenerated (uv pip compile setup.py --output-file requirements.txt --no-emit-index-url) and guarded byscripts/check_requirements_parity.py, so it must not be hand-edited. Exact sequence:setup.py— add a URL constant beside the existing ones (API_CLIENTS_URL,SERVICE_LIB_URL, …):sqlalchemy-drill==1.1.2requirement withf"sqlalchemy-drill @ {SQLALCHEMY_DRILL_URL}".requirements.txtby hand. Expect line 1480 to become asqlalchemy-drill @ https://…direct reference, matching thepyhive @ <internal-index-base>/PyHive/pyhive-0.7.0.1.tar.gzprecedent at line 1152.config/sqlalchemy-driver-manifest.json,connectors[11].packages[0]— setlocked_versionto the same full URL (this is exactly how thehiveandprestoconnectors already record their Preset-built PyHive). Then update the qualification fields, which currently understate what is now known:sqlalchemy_claim→==2.0.52verified,runtime_verified→true,evidence_tier→ live REST integration rather thanresolve/import only,status→ resolved, and refreshnotes.tests/scripts/test_requirements_parity.py) plus Shell's own suite.published.sha256, not rebuilt locally — in the PR description for provenance.Steps 1–5 are blocked until the wheel is actually published, since the URL must resolve.
Exact Jenkins-admin action required
A Jenkins administrator must create a multibranch pipeline job for
preset-io/sqlalchemy-drill, configured like the existingclaude-commands/service-lib-pyjobs:preset-io/sqlalchemy-drill, discovering branches and PRs.Jenkinsfile(repo root).ci-user— already present in Jenkins and already granteds3:*onarn:aws:s3:::preset-pypi. No new secret needs to be created.Nothing else is blocked on credentials. Once the job exists, a PR build publishes the pre-release
1.1.11.1+PR-<n>.<sha>and amasterbuild publishes stable1.1.11.1, both as wheel-only immutable uploads.