List the files tracked as inputs to the image. These files are used to compute the fingerprint for the image. See `ResolvedImage.fingerprint` for details. Returns: inputs: A list of input files, relative to the root of the repository.
(self, transitive: bool = False)
| 1252 | |
| 1253 | @cache |
| 1254 | def inputs(self, transitive: bool = False) -> set[str]: |
| 1255 | """List the files tracked as inputs to the image. |
| 1256 | |
| 1257 | These files are used to compute the fingerprint for the image. See |
| 1258 | `ResolvedImage.fingerprint` for details. |
| 1259 | |
| 1260 | Returns: |
| 1261 | inputs: A list of input files, relative to the root of the |
| 1262 | repository. |
| 1263 | """ |
| 1264 | if self.image._context_files_cache is not None: |
| 1265 | paths = set(self.image._context_files_cache) |
| 1266 | else: |
| 1267 | paths = set(git.expand_globs(self.image.rd.root, f"{self.image.path}/**")) |
| 1268 | if not paths: |
| 1269 | # While we could find an `mzbuild.yml` file for this service, expland_globs didn't |
| 1270 | # return any files that matched this service. At the very least, the `mzbuild.yml` |
| 1271 | # file itself should have been returned. We have a bug if paths is empty. |
| 1272 | raise AssertionError( |
| 1273 | f"{self.image.name} mzbuild exists but its files are unknown to git" |
| 1274 | ) |
| 1275 | for pre_image in self.image.pre_images: |
| 1276 | paths |= pre_image.inputs() |
| 1277 | if transitive: |
| 1278 | for dep in self.dependencies.values(): |
| 1279 | paths |= dep.inputs(transitive) |
| 1280 | return paths |
| 1281 | |
| 1282 | @cache |
| 1283 | def fingerprint(self) -> Fingerprint: |
no test coverage detected