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

Back port recent fixes to 1.5 branch #1130

Merged
merged 4 commits into from
Nov 5, 2024

Commits on Nov 5, 2024

  1. Compute Python constraints from a bare image.

    To compute the set of Python constraints, we install all the Python
    packages we need in a bare Ubuntu image (same version as the one used to
    build the ODK itself) in which we only install Python3 and PIP.
    
    This ensure that `pip-constraints.txt`, the list of Python packages that
    are installed by the system and that PIP should not touch no matter
    what, always reflect the actual list of system-managed Python packages
    found in the ODK.
    
    This has the side-effect of allowing to use the `update-constraints.sh`
    script for the specific case of bootstrapping the constraints when the
    base image is upgraded to a newer version of Ubuntu, something that
    previously necessitated an undocumented manual operation.
    gouttegd committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    07b693a View commit details
    Browse the repository at this point in the history
  2. Warn if system-managed Python packages differ from expected.

    When building the ODK builder image, before attempting to install the
    Python packages, we obtain the list of packages that have already been
    installed by the system (i.e. by APT) and compare it with the
    pre-computed list in `pip-constraints.txt`.
    
    The two lists should normally always be the same. They MAY differ if,
    between the time the constraints were last updated and the current
    build, Ubuntu updated some of its Python packages (e.g. if they bump
    `python3-setuptools` to a more recent minor version because of a
    security vulnerability). If that happens, we allow the build to continue
    (it may not necessarily cause a fatal error), but we log a warning so
    that, should the build fail, we will know that we likely need to refresh
    the constraints to reflect the updated Ubuntu packages.
    gouttegd committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    9e02666 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b705308 View commit details
    Browse the repository at this point in the history
  4. Correctly set default repo name.

    If the ODK seeding configuration file does not define the name of the
    repository (`repo`) and if no name is explicitly given on the command
    line, we want to set a default repository name ("noname") to prevent a
    crash when generating the files.
    
    Unfortunately, the way this was done (#1097) makes any `repo` value
    defined in the configuration _ignored_, because we:
    
    * first set `repo` to "noname" if we didn't get anything from the
      command line;
    * then call `load_config` with whatever value we have for `repo` (hether
      it comes from the command line or from our default), and `load_config`
      takes whatever value we give it and **overrides** any value it may
      have found in the config file.
    
    So here, we define a default value for `project.repo` at the moment that
    field is declared (as for all other default values), and do **not** set
    a default value in the main function.
    
    This way:
    
    * if no `repo` argument is given in the command line, we get the value
      from the configuration file, or the default value if there is `repo`
      key in the config file;
    * if a `repo` argument is given in the command line, it overrides both
      any value that may be set in the configuration file, and the default
      value.
    gouttegd committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    5cd82d5 View commit details
    Browse the repository at this point in the history