epugh opened a new pull request, #199: URL: https://github.com/apache/solr-orbit/pull/199
## Problem Solr Orbit can't start Solr when it runs as root, as it often does in containers and CI. - `bin/solr start` refuses to run as root unless a force flag is passed. - `ProcessLauncher` and `LocalProcessLauncher` go further and raise `Cannot launch Solr as root` before they even try. ## Fix A new helper, `solr_force_args(major_version)` in `builder/solr_provisioner.py`, picks the flag: - **Not root:** no extra arguments. - **Root:** it logs a warning and returns `-force` for Solr < 10 and `--force` for Solr 10+. `SolrProvisioner.start()`, `ProcessLauncher._start_process()` and `LocalProcessLauncher._start_process()` all use it. The two "Cannot launch Solr as root" checks are removed. Flag support, read from each version's `bin/solr` source: | Solr version | `-force` | `--force` | |---|---|---| | 8.0 – 8.11 | ✅ | ❌ | | 9.0 – 9.6 | ✅ | ❌ | | 9.7 – 9.10 | ✅ | ✅ | | 10 (`main`) | ❌ | ✅ | ## Tests - Unit tests for the helper, for root and non-root on Solr 9 and 10. - Unit tests that the command built by each of the three start paths includes the right flag as root and leaves it out otherwise. - The full `pytest tests` suite passes and `ruff check` is clean. - Not run as root against a live Solr. This touches the same launcher files as #198 (`--cloud` → `-c`) but not the same lines in the source. Both PRs add tests at the end of the same test files, so the second one to merge may need a trivial merge fix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018RwsEjxzCyQRNsLe9PnjZK -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
