posit-dev / posit-dev/images-shared

Fix handling of unknown build OSes to not produce errors

Open
#109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug cvp:1 docker tdp:1
Dominant language
Python
Stars
2
Forks
0
Avg merge
4d 13h
Merged PRs (30d)
22

Description

We should anticipate end users utilizing any variety of base operating systems that we may not have coded in as BuildOS objects to bakery. Currently, attempting to load a project with an arbitrary OS will result in an error because the build_os.image_tag attribute will be None in ImageVariant.load. We should fix this behavior so users are warned on utilizing an arbitrary OS, but any operations performed with an arbitrary OS still succeed.

How to Reproduce
  1. Create a temp directory to test in and use it as working directory.
  2. Run bakery create project.
  3. Run bakery create image test.
  4. Change extension on Containerfile.jinja2 to Containerfile.randomos.jinja2. (See #108)
  5. Run bakery create version test 1.0.0. This will propagate an error during tag rendering because attributes for the BuildOS object are not set.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at ImageVariant.load and the tag-rendering path used by bakery create version test 1.0.0; compare how known BuildOS objects are handled. Done means an unrecognized Containerfile..jinja2 produces a warning instead of an error and the create-version operation succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.