LITE-33583: bump extension projects to the latest runner#254
Conversation
`bump` selected the runner image by the Connect platform major, which is obsolete now that the runner follows its own semver line — it silently picked a stale image. Use the latest published runner instead, matching the bootstrap behavior. Bumping only the docker images would recreate the bootstrap dependency mismatch on existing projects (new runner, stale pyproject pins), so bump now also rewrites the `python` and `connect-eaas-core` entries in [tool.poetry.dependencies] with the specifiers derived from the runner's PyPI metadata. The rewrite is line-level to preserve the file's formatting, and dev-dependencies are left untouched. Drop the now-unused get_pypi_runner_version_by_connect_version().
arnaugiralt
left a comment
There was a problem hiding this comment.
Added a couple of non blocking comments, they are about docs and hardening.
| if new_value and stripped != f'{key} = "{new_value}"': | ||
| line = f'{key} = "{new_value}"\n' | ||
| to_be_replaced = True |
There was a problem hiding this comment.
This loop only matches keys written as name = "spec". If the key is written any other way, the loop does nothing and does not tell anyone. Two cases hit this: a quoted key like "connect-eaas-core" = ">=30", and a table form like connect-eaas-core = { version = ">=30" }. In both cases the old version stays in the file next to the new runner. That is the same mismatch this PR wants to fix, but now it is silent. Bootstrap never writes those forms, so this only happens on files a user edited by hand. Please track which keys in new_values you actually updated. For any key you did not update, print a yellow warning telling the user to check pyproject.toml by hand.
| if stripped.startswith('['): | ||
| section = stripped | ||
| elif section == '[tool.poetry.dependencies]': | ||
| # ponytail: handles the plain `name = "spec"` form bootstrap emits; a |
There was a problem hiding this comment.
Two things about this comment. First, rewriting a table form to the plain form also drops any extra fields on that line, such as extras, markers, optional, or source. Second, and worse, a value that spans more than one line breaks. The code only rewrites the first line, so the leftover lines ({ ... }, and ]) stay behind and the file is no longer valid TOML. This is unlikely for python and connect-eaas-core, but if it happens the project stops building. If you keep this approach, please add one line to the comment saying it only supports single-line values.
Follow-up to @qarlosh's comment on #252.
Problem
ccli project extension bumpselected the runner image by the Connect platform major (get_pypi_runner_version_by_connect_version()). Now that the runner follows its own semver line, that lookup silently picks a stale image.Fix
bumpnow uses the latest published runner, same as bootstrap.pythonandconnect-eaas-coreentries in[tool.poetry.dependencies]with the specifiers derived from the runner's PyPI metadata. Line-level rewrite — file formatting and dev-dependencies untouched. Skipped if the project has nopyproject.toml.get_pypi_runner_version_by_connect_version()(no remaining users).Verification
test_bump_runner_versionnow also asserts the pyproject pins get updated and dev-deps stay untouched.