Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release log formatting #486

Merged
merged 4 commits into from
Oct 16, 2020
Merged

Update release log formatting #486

merged 4 commits into from
Oct 16, 2020

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Mar 27, 2020

Like OpenShot/libopenshot-audio#92, this makes some tweaks to the git commands that the builders use to generate the install*/share/repo.log file during each build stage, to make the contents maximally conducive to cut-and-paste insertion directly into a GitHub Release description.

From the libopenshot-audio PR:

Some more tweaks to the log-o-commits formatting, when generated by the GitLab builders:

  • The actual format string is stored in an environment variable, to avoid retyping four times
  • MarkDown-friendly output (including the leading '- ' on each line), so that the file contents can be directly cut-and-pasted into a Release description
  • Removed all of the color escapes, since they're pointless while redirecting the output
  • Removed the branch/tag labels for commits as unnecessary information
  • Fields rearranged to non-columnar format (making width limits unnecessary)
  • --pretty=tformat: is used, to ensure a trailing newline
  • --no-merges added, to reduce clutter

Here's an example run listing the changes since v0.2.5:

$ GIT_LOG_FORMAT="- %h %ad %s [%aN]" && git log v0.2.5.. --oneline --date=short --no-merges --pretty="tformat:$GIT_LOG_FORMAT"
- 2701cf9 2020-03-26 Add frame rate test to FFmpegReader_Tests [FeRD (Frank Dana)]
- fda1357 2020-03-26 Ignore ctags file (#482) [Chiller Dragon]
- 455b6e9 2020-03-26 Fix float to int16_t conversion in resampler [SuslikV]
- 5e899bf 2020-03-25 Add SWIG/Ruby compatibility check & warning (#480) [Frank Dana]
- 0a5dfd9 2020-03-26 Fix zmq version check (#478) [Chiller Dragon]
- adf6165 2020-03-25 Add version reporting to FindZeroMQ [FeRD (Frank Dana)]
- 54f5fea 2020-03-25 ZeroMQ's std::string support is too new [FeRD (Frank Dana)]
- 4fad197 2020-03-23 Add version gating for Zmq and Qt deprecations (#470) [Frank Dana]
- 94e9ad3 2020-03-23 bindings: Remove relative header paths (#469) [Frank Dana]
- 2684015 2020-03-23 python/CMakeLists: Lowercase commands, indents [Frank Dana]
- bb20a9b 2020-03-23 ruby/CMakeLists: Lowercase commands [Frank Dana]
- 818ce5a 2020-03-19 Exclude thirdpart/jsoncpp from Codecov scanning [FeRD (Frank Dana)]
- b738460 2020-03-19 Clip_Tests: Remove try/catch blocks [FeRD (Frank Dana)]
- 54a82ff 2020-03-16 Fix test sample values [SuslikV]
- dff4201 2020-03-16 Restore default gain when adding audio [SuslikV]
- c28a8bf 2020-03-16 Fix float to int16_t conversion [SuslikV]
- 816118b 2020-03-12 CMake: Use GNUInstallDirs for install paths (#457) [Frank Dana]
- e19291a 2020-03-12 Travis: Drop extra FFmpeg 3.4 GCC job (#463) [Frank Dana]
- 4058dde 2020-03-10 ReaderBase_Tests: 100% internal coverage (#462) [Frank Dana]
- a21e328 2020-03-10 Updating auto-stale conditions (90 days warning, 10 days to respond, only issues, ignore assigned issues) [Jonathan Thomas]
- 4ea3623 2020-03-10 Adding support for proper absolute/canonical path detection and replacement [Jonathan Thomas]
- de42a90 2020-03-09 Adding stale bot for github issue management [Jonathan Thomas]
- 8b3167a 2020-03-09 Adding ability for a Clip to auto-detect and instantiate a Timeline Reader from the *.osp file type. Added new Timeline constructor, to auto load UTF-8 JSON file, and regex convert all paths to absolute. Fixed a dead lock issue when a Timeline loads another Timeline. [Jonathan Thomas]
- f5ab99f 2020-03-09 Travis: Use CMAKE_INSTALL_PREFIX [FeRD (Frank Dana)]
- 20fffc4 2020-03-09 bindings: Relative paths, overridable [FeRD (Frank Dana)]
- efe0728 2020-03-03 Bump version to -dev2 (merge master back to develop) [Jonathan Thomas]
- 7fbd44a 2020-03-02 ColorShift: Use one-word name in EffectInfo (#453) [Frank Dana]
- e7bd918 2020-02-24 Change frame rate detection [SuslikV]

And if I cut-and-paste that output here, unmodified:

@codecov-io
Copy link

Codecov Report

Merging #486 into develop will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #486   +/-   ##
========================================
  Coverage    48.24%   48.24%           
========================================
  Files          128      128           
  Lines         9962     9962           
========================================
  Hits          4806     4806           
  Misses        5156     5156           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12dd4d1...ff5095c. Read the comment docs.

@jonoomph
Copy link
Member

jonoomph commented May 26, 2020

@ferdnyc These log files are parsed in openshot-qt, on our About dialog. They are copied into openshot-qt on the freeze.py script:

# Copy git log files into src files (if found)
for project in ["libopenshot-audio", "libopenshot", "openshot-qt"]:
    git_log_path = os.path.join(PATH, "build", "install-x64", "share", "%s.log" % project)
    if os.path.exists(git_log_path):
        src_files.append((git_log_path, "settings/%s.log" % project))
    else:
        git_log_path = os.path.join(PATH, "build", "install-x86", "share", "%s.log" % project)
        if os.path.exists(git_log_path):
            src_files.append((git_log_path, "settings/%s.log" % project))

And then we parse them on about.py:

        for project in ['openshot-qt', 'libopenshot', 'libopenshot-audio']:
            changelog_path = os.path.join(info.PATH, 'settings', '%s.log' % project)
            if os.path.exists(changelog_path):
                # Attempt to open changelog with utf-8, and then utf-16-le (for unix / windows support)
                for encoding_name in ('utf-8', 'utf_16_le'):
                    try:
                        with codecs.open(changelog_path, 'r', encoding=encoding_name) as changelog_file:
                            if changelog_file.read():
                                self.btnchangelog.setVisible(True)
                                break
                    except:
                        # Ignore decoding errors
                        pass

Just wanted to make sure that if we change the git log format (which I like by the way), that it will not break our About dialog. And if it does break, perhaps we can just patch the parsing logic in openshot-qt, so we can have the best of both worlds. 😄

Needed things...

  • Update all 3 repos with this same git log format
  • Fix parsing logic on openshot-qt::about.py to support this markdown

@codecov-commenter
Copy link

codecov-commenter commented May 26, 2020

Codecov Report

Merging #486 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #486   +/-   ##
========================================
  Coverage    48.77%   48.77%           
========================================
  Files          129      129           
  Lines        10036    10036           
========================================
  Hits          4895     4895           
  Misses        5141     5141           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf0159b...9482861. Read the comment docs.

@ferdnyc
Copy link
Contributor Author

ferdnyc commented May 26, 2020

@ferdnyc These log files are parsed in openshot-qt, on our About dialog.

Ohhh! That, I did not realize, thanks.

Just wanted to make sure that if we change the git log format (which I like by the way), that it will not break our About dialog.

Yeah, agreed. I wasn't aware of the extra dependency there. It'll definitely need more testing and cleanup. To WIP it goes, for now!

@ferdnyc ferdnyc changed the title Update release log formatting WIP: Update release log formatting May 26, 2020
@ferdnyc ferdnyc changed the title WIP: Update release log formatting Update release log formatting Aug 7, 2020
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Aug 7, 2020

This is no longer WIP, though it does now depend on OpenShot/openshot-qt#3653 getting merged first.

@jonoomph jonoomph merged commit 898ec16 into develop Oct 16, 2020
@jonoomph
Copy link
Member

LGTM! Thanks! I love the markdown support!

@jonoomph jonoomph deleted the release-logs branch October 16, 2020 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants