From 94b4a54584124f21b4e3cfe1a818420f57f1a585 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Tue, 2 Apr 2024 18:30:10 +0100 Subject: [PATCH] Update Changelog script to include changes in lib dependencies. --- .github/tools/gitchanges.py | 42 ++++++++++++++++++++++++++---- Changelog.md | 51 ++++++++++++++++++------------------- 2 files changed, 62 insertions(+), 31 deletions(-) diff --git a/.github/tools/gitchanges.py b/.github/tools/gitchanges.py index a39af801..d4916c9e 100755 --- a/.github/tools/gitchanges.py +++ b/.github/tools/gitchanges.py @@ -49,9 +49,14 @@ def getTags(): tags = filter(lambda x: "-" not in x, tags) return natsorted(tags,reverse=True) -def getCommitsBetween( tagA, tagB = "HEAD" ): - commits = os.popen(f"git -P shortlog {tagA}..{tagB}").read().strip().splitlines() - return "\n".join(map( lambda x: x.replace(" ", " - "), commits )) +def getCommitsBetween( tagA, tagB = "HEAD", dir=None): + if dir: + original_dir = os.getcwd() + os.chdir(dir) + commits = os.popen(f'git log --format="%s (by %an)" --no-merges --reverse {tagA}..{tagB}').read().strip().splitlines() + if dir: + os.chdir(original_dir) + return "\n - ".join([""] + commits) def getRepoURL(): origin = os.popen("git remote get-url origin").read().strip().split( "github.com/", maxsplit=1 ) @@ -62,6 +67,22 @@ def printLibraryLinks(): for lib in config['libraries']: output( F" - {lib['name']} = {lib['url']}/tree/{lib['branch']}" ) +def getOldAndNewLibCommits(old_commit, new_commit): + old_target_locked = json.loads(os.popen(f"git show {old_commit}:target-locked.json").read()) + new_target_locked = json.loads(os.popen(f"git show {new_commit}:target-locked.json").read()) + lib_versions = {} + # We only have a handful of libraries in the list, okay to be inefficient + for old_lib in old_target_locked["libraries"]: + for new_lib in new_target_locked["libraries"]: + if old_lib["name"] == new_lib["name"]: + lib_versions[old_lib["name"]] = { + "old": old_lib["branch"], + "new": new_lib["branch"], + "url": old_lib["url"] + } + return lib_versions + + tags = getTags() defaultTag = "v0.0.1" @@ -109,12 +130,23 @@ def printLibraryLinks(): print( "Nothing to do, Stop." ) exit( 0 ) + # Target commits logURL = f"{url}compare/{lastTag}...{options.tag}" - output( f"## [{options.tag}]({logURL})", forcePrint=True ) - output( '', forcePrint=True ) output( getCommitsBetween( lastTag, options.tag ), forcePrint=True ) + + # Library commits + libInfo = getOldAndNewLibCommits( lastTag, options.tag ) + for libName, lib in libInfo.items(): + libCommits = getCommitsBetween(lib['old'], lib['new'], dir=f"../{libName}") + if libCommits: + diffUrl = f"{lib['url']}/compare/{lib['old']}...{lib['new']}" + diffUrlMarkdown = f"[{lib['old'][:7]}...{lib['new'][:7]}]({diffUrl})" + output(f"\n### {libName} ({diffUrlMarkdown})", forcePrint=True) + output(libCommits, forcePrint=True) + output( '', forcePrint=True ) + output( line ) else: output( line ) diff --git a/Changelog.md b/Changelog.md index 6eee7416..dbadb439 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,39 +10,38 @@ The current tag uses the following library versions: ## [v0.2.66](https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.65...v0.2.66) -Dr John Vidler (2): - - Applying the patch suggested by @dpgeorge to handle large receiving buffers for pullInto() - - Update Changelog.md - - Snapshot v0.2.66 + - Updated the Changelog (by Github Actions) + - Update Changelog.md (by Dr John Vidler) + - Snapshot v0.2.66 (by Dr John Vidler) -Github Actions (1): - - Updated the Changelog +### codal-core ([7b6f9df...992c0b1](https://github.com/lancaster-university/codal-core/compare/7b6f9df3b586f8dd9bede4bd0baa0cdc212b6ba2...992c0b11a0eb2a1edca9c2f76821f89a99a3acec)) + + - Applying the patch suggested by @dpgeorge to handle large receiving buffers for pullInto() (by Dr John Vidler) ## [v0.2.65](https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.63...v0.2.65) -Carlos Pereira Atencio (1): - - Set MICROBIT_RADIO_MAX_PACKET_SIZE as a configurable value. (#387) - -Dr John Vidler (10): - - Merged patch to fix the various sample rate issues - - Corrected Changelog.md after my tag snarfu - - Refined the changelog script to only update the head of the log under normal cases - - Resolved conflict in the manual updates to the ChangeLog - - Added a new CONFIG_MIXER_DEFAULT_CHANNEL_SAMPLERATE constant for channels with no defined rate to use - - Fixed a bug where in some conditions the microphone would not auto-start - - Added MicroBitButton.h to the required includes for MicroBitCompat.h so its still included in the build when not using bluetooth - - Moved the MicroBitButton inclusion to the tail of MicroBitCompat to avoid circular dependencies or a bunch of needless forward declarations - - Bumped the default Mixer2 channel sample rate back up to 44100 - - Snapshot v0.2.65 + - Updated the Changelog (by Github Actions) + - Corrected Changelog.md after my tag snarfu (by Dr John Vidler) + - Refined the changelog script to only update the head of the log under normal cases (by Dr John Vidler) + - Set MICROBIT_RADIO_MAX_PACKET_SIZE as a configurable value. (#387) (by Carlos Pereira Atencio) + - Change datalog CSV download mime type from text/plain to text/csv (#339) (by Martin Williams) + - Added a new CONFIG_MIXER_DEFAULT_CHANNEL_SAMPLERATE constant for channels with no defined rate to use (by Dr John Vidler) + - Fixed a bug where in some conditions the microphone would not auto-start (by Dr John Vidler) + - Update MicroBitLog to support 3 header formats (#399) (by Matt Hillsdon) + - Added MicroBitButton.h to the required includes for MicroBitCompat.h so its still included in the build when not using bluetooth (by Dr John Vidler) + - Moved the MicroBitButton inclusion to the tail of MicroBitCompat to avoid circular dependencies or a bunch of needless forward declarations (by Dr John Vidler) + - Bumped the default Mixer2 channel sample rate back up to 44100 (by Dr John Vidler) + - Snapshot v0.2.65 (by Dr John Vidler) -Github Actions (1): - - Updated the Changelog +### codal-core ([63f017f...7b6f9df](https://github.com/lancaster-university/codal-core/compare/63f017fdcd12aca769264c36fe47e6071a40e502...7b6f9df3b586f8dd9bede4bd0baa0cdc212b6ba2)) -Martin Williams (1): - - Change datalog CSV download mime type from text/plain to text/csv (#339) + - Updated to correctly restore mic state on returning from a deep sleep (by Dr John Vidler) + - Typo (by Dr John Vidler) + - Working audio resampling rates if requested by downstream components of a SplitterChannel (by Dr John Vidler) -Matt Hillsdon (1): - - Update MicroBitLog to support 3 header formats (#399) +### codal-microbit-nrf5sdk ([5714cbe...d41d5c7](https://github.com/microbit-foundation/codal-microbit-nrf5sdk/compare/5714cbe338c3544793bbb841a7ae81708a3ffae1...d41d5c7ebe53a1d01935e61d4ffa891e5112e119)) + + - Revert "Quieted a warning on fallthrough, as this is intended behaviour" (by Dr John Vidler) ## [v0.2.63](https://github.com/lancaster-university/codal-microbit-v2/compare/v0.2.62...v0.2.63)