Skip to content

feat: add a command "hide" and embed meta data to comment #210

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

Merged
merged 7 commits into from
Jan 24, 2021

Conversation

suzuki-shunsuke
Copy link
Owner

@suzuki-shunsuke suzuki-shunsuke commented Jan 24, 2021

#205

Feature

  • Add a command hide, which hides old comments
$ github-comment hide

hide config

ex.

---
hide:
  plan: 'Comment.HasMeta && (Comment.Meta.SHA1 != Commit.SHA1 || Comment.Meta.Vars.target == "foo")'
$ github-comment hide -k plan

Breaking Changes

  • a HTML comment is embedded to a comment
  • remove the feature to hide comments in post and exec command

ex.

<!-- github-comment: {"SHA1":"79acc0778da6660712a65fd41a48b72cb7ad16c1","TemplateKey":"default","JobID":"xxx","JobName":"plan"} -->

Embeded meta data

  • SHA1
  • TemplateKey
  • Vars
  • JobID (optional)
  • JobName (optional)
  • WorkflowName (optional)

These meta data can be referred in hide condition as Comment.Meta.

Motivation

We think the current specification to hide comments has some problems.
It is inefficient to get comments and extract hidden comments from them several times.

So instead of hiding comments in post and exec command, we should call hide command in the begging of the CI.

@suzuki-shunsuke suzuki-shunsuke added this to the v3.0.0 milestone Jan 24, 2021
@suzuki-shunsuke suzuki-shunsuke merged commit 5d1793c into master Jan 24, 2021
@suzuki-shunsuke suzuki-shunsuke deleted the feat/embed-metadata branch January 24, 2021 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant