Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions py/envoy.code.check/envoy/code/check/abstract/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ def version_higher_than_current(self) -> bool:
> _version.Version(self.project.version.base_version))

async def check_date(self) -> tuple[str, ...]:
# In the entries layout the current changelog has no real date; it is
# synthesized as `Pending` until `write_version` bakes a dated file,
# so there is nothing to validate here.
if self.is_current and self.project.changelogs.entries_layout:
# The current changelog's date is synthesized as `Pending` from the
# entry files until `write_version` bakes a dated file, so there is
# nothing to validate here.
if self.is_current:
return ()
errors = []
if invalid_date := await self.invalid_date:
Expand Down
10 changes: 5 additions & 5 deletions py/envoy.code.check/tests/test_abstract_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,6 @@ async def test_changelogstatus_check_date(
dict(new_callable=PropertyMock)),
("AChangelogStatus.pending_not_dev",
dict(new_callable=PropertyMock)),
("AChangelogStatus.project",
dict(new_callable=PropertyMock)),
("AChangelogStatus.version",
dict(new_callable=PropertyMock)),
prefix="envoy.code.check.abstract.changelog")
Expand All @@ -517,8 +515,7 @@ async def test_changelogstatus_check_date(
expected.append("Should not be set to `Pending`")

with patched as (
m_tuple, m_dev, m_invalid, m_current, m_pending, m_project,
m_version):
m_tuple, m_dev, m_invalid, m_current, m_pending, m_version):
m_current.return_value = False
m_invalid.side_effect = AsyncMock(return_value=invalid_date)
m_dev.side_effect = AsyncMock(return_value=dev_not_pending)
Expand Down Expand Up @@ -548,15 +545,18 @@ async def test_changelogstatus_check_date_current(patches):
dict(new_callable=PropertyMock)),
("AChangelogStatus.pending_not_dev",
dict(new_callable=PropertyMock)),
("AChangelogStatus.project",
dict(new_callable=PropertyMock)),
prefix="envoy.code.check.abstract.changelog")

with patched as (m_dev, m_invalid, m_current, m_pending):
with patched as (m_dev, m_invalid, m_current, m_pending, m_project):
m_current.return_value = True
assert await status.check_date() == ()

assert not m_invalid.called
assert not m_dev.called
assert not m_pending.called
assert not m_project.called


async def test_changelogstatus_check_date_historical_pending(
Expand Down