Skip to content

Commit

Permalink
CI:Update Changelog script to include changes in lib dependencies. (#420
Browse files Browse the repository at this point in the history
)
  • Loading branch information
microbit-carlos authored Apr 8, 2024
1 parent 9a03c69 commit a3492c4
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 31 deletions.
42 changes: 37 additions & 5 deletions .github/tools/gitchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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"
Expand Down Expand Up @@ -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 )
Expand Down
51 changes: 25 additions & 26 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a3492c4

Please sign in to comment.