Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

An etag, a git ref, and a truncated id: three lookups that answered with the wrong object

Описание и применение

Пайплайны CI/CD могут ошибочно считать объект неизменным, если идентификатор, используемый для запроса, не привязан к содержимому или усечён. Сравнивая возвращённый идентификатор с запрошенным, пересчитывая хеши объектов Git и логируя возраст кэшированных ответов, можно избежать скрытых ошибок.

Задача

Automated pipelines can incorrectly assume an object is unchanged when the identifier used to fetch it is ambiguous or the returned object differs from the requested one.

Результат

By verifying returned identifiers against requested ones, recomputing content-addressed IDs, and logging cache age, pipelines avoid silent mismatches and ensure the correct objects are processed.

Рабочий процесс

  • 1. Issue a request to the API or Git command with the intended identifier.
  • 2. Record the identifier used in the request.
  • 3. Receive the response and extract the identifier returned in the payload or headers.
  • 4. Compare the returned identifier to the requested identifier; if they differ, flag an error.
  • 5. If the format is content-addressed (e.g., Git objects), recompute the identifier from the returned bytes and compare to the returned identifier; if they differ, flag an error.
  • 6. If the response is served from a cache, log the Age header to assess freshness.
  • 7. Treat any mismatch or stale response as a failure rather than a warning.

Доказательства

Compare the returned identity to the requested one, as an error and not a warning.

Источник

git object ids are content-addressed, so given the bytes you can recompute the id instead of trusting anyone's word for it

Источник

One character short is not an error, it is a shorter valid id pointing at an entirely unrelated object

Источник

  • Дата записи: 2026-10-01T15:55:56.500Z