Skip to content

Commit f0d47b0

Browse files
authored
create-news: add timestamp to news file name (#58)
Add timestmap along with year, month and date format of news filename to avoid conflicts generated with multiple PRs created on the same day. Rebasing on master create conflicts and only possible solution is to remove the conflicting news file and creating it again. Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
1 parent c60b11e commit f0d47b0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

mbed_tools_ci_scripts/create_news_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _write_file(file_path: pathlib.Path, text: str) -> None:
6161

6262

6363
def _determine_todays_news_file_name() -> str:
64-
return datetime.now().strftime("%Y%m%d")
64+
return datetime.now().strftime("%Y%m%d%H%M%S")
6565

6666

6767
def main() -> int:

news/20200707185215.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add timestamp to news file name

tests/test_create_news_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_creates_a_file_with_available_file_name_and_returns_its_path(self, _wri
2929
class TestDetermineNewsFilePath(TestCase):
3030
def test_finds_first_available_file_path_in_news_dir(self):
3131
news_dir = configuration.get_value(ConfigurationVariable.NEWS_DIR)
32-
news_file_name_today = datetime.now().strftime("%Y%m%d")
32+
news_file_name_today = datetime.now().strftime("%Y%m%d%H%M%S")
3333
news_file_path_today = str(pathlib.Path(news_dir, news_file_name_today))
3434

3535
for news_type in NewsType:

0 commit comments

Comments
 (0)