Skip to content

Commit

Permalink
Generate relase notes (#99)
Browse files Browse the repository at this point in the history
* add script to generate release notes and upset release-notes pr
* build.gradle: patch plugin.xml with last release note and simpplify plugin version number

the last release notes is extracted from the changelog
the version of the plugin is now - where:
  * pluginversion comes from gradle property. (this prop will be overwritten by github action with the tag of the release)
  * platformVersion= 202 or 203
  * chanel =  for release,  dev for testing

* github action: add wokflow to genereate release-notes pr and release plugin
* add documentation about release process
* disable build seached options because it create exception with 203 when build plugin
* updat version of org.jetbrains.intellij plugin to 0.7.3 to fix dependcy problem with bintray

Signed-off-by: Vincent Gramer <vgramer@gmail.com>
  • Loading branch information
vgramer authored Nov 23, 2021
1 parent d881435 commit 4c0b308
Show file tree
Hide file tree
Showing 13 changed files with 694 additions and 10 deletions.
14 changes: 14 additions & 0 deletions .github/release-notes-pr-description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Update changelog

# Description
This PR is generated by the GitHub action and automatically updated when
Pr(s) are merged on master.

It should stay in draft until we release.

# Merging instruction
This pr must be merged last, just before releasing.

1. edit the title of last release notes to change `NEXT_VERSION`by the actual version (you can do it in GitHub interface)
1. merge pr using **squashing** strategy
1. tag the `master` branch with the actual version (this will create a Github release and publish the plugin on Jetbrains store)
18 changes: 18 additions & 0 deletions .github/release-notes.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Release notes for NEXT_VERSION

{{with .NotesWithActionRequired -}}
## Urgent Upgrade Notes

### (No, really, you MUST read this before you upgrade)

{{range .}}{{println "-" .}} {{end}}
{{end}}

{{- if .Notes -}}
## Changes by Kind
{{ range .Notes}}
### {{.Kind | prettyKind}}

{{range $note := .NoteEntries }}{{println "-" $note}}{{end}}
{{- end -}}
{{- end -}}
76 changes: 76 additions & 0 deletions .github/workflows/release_and_pulbish_plugin_on_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: publish plugin on JB and create release on GH

on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
jobs:
check-gradle-wrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1

publish_plugin:
runs-on: ubuntu-latest
needs: [check-gradle-wrapper]
strategy:
matrix:
platform-version: [ 203, 211 ]
env:
ORG_GRADLE_PROJECT_platformVersion: ${{ matrix.platform-version }}
ORG_GRADLE_PROJECT_publishChannel: stable
ORG_GRADLE_PROJECT_publishToken: ${{ secrets.PUBLISH_TOKEN }}
steps:
# Cache gradle dependencies
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/checkout@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: publish plugin
run: |
export ORG_GRADLE_PROJECT_pluginVersion="${GITHUB_REF/refs\/tags\//}"
./gradlew :plugin:publishPlugin
- name: Upload artifact
uses: actions/upload-artifact@v2.2.2
with:
name: plugin-artifact
path: ./plugin/build/distributions/*.zip
retention-days: 1
if-no-files-found: error

create_github_release:
runs-on: ubuntu-latest
needs : [ publish_plugin ]
steps:
- uses: actions/checkout@v2
- name: Download Artifact
uses: actions/download-artifact@v2
id: download
with:
name: plugin-artifact
path: ./artifacts/

- name: create or update release note PR
env:
# Required for the `hub` CLI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${GITHUB_REF/refs\/tags\//}"
echo -e "${VERSION}\n" > gh_release_description.md
sed -e '0,/Release notes for v/d' -e '/Release notes for v/,$d' CHANGELOG.md >> gh_release_description.md
assets=''
for file in $(ls ./artifacts/); do assets="${assets} -a ./artifacts/${file}"; done
echo "assets=${assets}"
hub release create -F gh_release_description.md ${assets} "${VERSION}"
27 changes: 27 additions & 0 deletions .github/workflows/upset_release_notes_pr_on_push_on_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Create or update release notes PR

on:
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
upset_release_notes_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# needed to be able to resolve commit of previous version
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: "1.16"
- name: Download release-note tool
run: GO111MODULE=on go get k8s.io/release/cmd/release-notes@v0.7.0

- name: create or update release note PR
env:
# Required for the `hub` CLI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./hack/create_or_update_release_notes_pr.sh
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ build/
gen/
deps

# MacOS files
.DS_Store

# release-notes file
next-release-notes.md
tmp_changelog.md
gh_release_description
130 changes: 130 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Release notes for v0.6.0

## Changes by Kind

### Feature

- Make plugin compatible with platform version 203 and 211 ([#101](https://github.com/open-policy-agent/opa-idea-plugin/pull/101), [@asadali](https://github.com/asadali))


# Release notes for v0.5.0

## Changes by Kind

### Refactoring

- Grammar: rename rules:
- `expr` to `literal-expr`
- `expr2` to `expr` ([#93](https://github.com/open-policy-agent/opa-idea-plugin/pull/93), [@vgramer](https://github.com/vgramer))
- Remove references to old repo `vgramer/opa-idea-plugin`. The repository has been transferred to `open-policy-agent` organization ([#83](https://github.com/open-policy-agent/opa-idea-plugin/pull/83), [@vgramer](https://github.com/vgramer))

### Bug or Regression

- Grammar: allow factor expression (ie parenthesis ). These expressions were passed as an error:
- `a4:= (1 - 3) - (2 +5)`
- `reverse(l) = [l[j] | _ = l[i]; j := (count(l) - 1) - i]` ([#92](https://github.com/open-policy-agent/opa-idea-plugin/pull/92), [@vgramer](https://github.com/vgramer))
- Grammar: allow complex expression as array index. These expressions were parsed as an error:
- `x:= x[minus(count(x),1)]`
- `index_last(l, x) = t[minus(count(t), 1)] { #something} else = -1 { # something}`
- `rule1{ x:= x[count(x) - 1)] }` ([#91](https://github.com/open-policy-agent/opa-idea-plugin/pull/91), [@vgramer](https://github.com/vgramer))
- Grammar: allow complex expression for array and object value. these expressions were parsed as an error:
- `arr7 := [1 + 2 - 4, count(arr6) / abs(arr5[0])`
- `a6 := { a: 1 > 2, b: { c: object.get(a2, a, default) + abs(c) - 2 }}` ([#90](https://github.com/open-policy-agent/opa-idea-plugin/pull/90), [@vgramer](https://github.com/vgramer))
- Grammar: allow empty query in else clause. These expressions were reported as an error
- `foo = true { input.x < input.y } else = false`
- `foo = true { false } else = { true }` ([#85](https://github.com/open-policy-agent/opa-idea-plugin/pull/85), [@vgramer](https://github.com/vgramer))


# Release notes for v0.4.0

## Changes by Kind

### Feature

- Implement auto closing quote feature ([#69](https://github.com/open-policy-agent/opa-idea-plugin/pull/69), [@vgramer](https://github.com/vgramer))
- Run [intellij-plugin-verifier](https://github.com/JetBrains/intellij-plugin-verifier) to check plugin binary compatibility in github action

1. update `org.jetbrains.intellij` Gradle plugin because the new version offers a task to run the plugin verifier. Consequently, remove the `ideaDependencyCachePath`customization which is not needed anymore.
2. add a job to run plugin verifier ([#62](https://github.com/open-policy-agent/opa-idea-plugin/pull/62), [@vgramer](https://github.com/vgramer))

### Bug or Regression

- Fix tests for github action and macOS Big Sur ([#73](https://github.com/open-policy-agent/opa-idea-plugin/pull/73), [@vgramer](https://github.com/vgramer))
- Grammar: allow import between rules and complex expression in else statement ([#80](https://github.com/open-policy-agent/opa-idea-plugin/pull/80), [@vgramer](https://github.com/vgramer))
- Grammar: don't allow multi-line in strings ([#67](https://github.com/open-policy-agent/opa-idea-plugin/pull/67), [@vgramer](https://github.com/vgramer))
- Grammar: fix rule-head and expr-infix
- `a:= 1 + 2` was parsed as an error
- assignment was valid inside affectation (eg `a := b = 1 + 2`) but should not.
- `a := 1 + 2 +3` was parsed as an error ([#74](https://github.com/open-policy-agent/opa-idea-plugin/pull/74), [@vgramer](https://github.com/vgramer))


# Release notes for v0.3.0

## Changes by Kind

### Bug or Regression

- Grammar: allow to use of infix operation as argument of a function. This expression was parsed as an error:
- `ARule(){ x := count({x} & {y}) }` ([#64](https://github.com/open-policy-agent/opa-idea-plugin/pull/64), [@vgramer](https://github.com/vgramer))

# Release notes for v0.2.0

## Changes by Kind

### Feature

- Implements auto-closing feature (brace, parenthesis and bracket ) ([#41](https://github.com/open-policy-agent/opa-idea-plugin/pull/41), [@vgramer](https://github.com/vgramer))
- Improve speed and security of CI Job:
- Cache gradle dependencies between run.
- check the signature of the Gradle wrapper. More info at [https://github.com/gradle/wrapper-validation-action](https://github.com/gradle/wrapper-validation-action) ([#55](https://github.com/open-policy-agent/opa-idea-plugin/pull/55), [@vgramer](https://github.com/vgramer))

### Documentation

- Fix typo in the documentation ([#54](https://github.com/open-policy-agent/opa-idea-plugin/pull/54), [@lukasz-kaminski](https://github.com/lukasz-kaminski))
- Update instruction du use stable channel when installing opa though Jetbrains market place ([#53](https://github.com/open-policy-agent/opa-idea-plugin/pull/53), [@vgramer](https://github.com/vgramer))

### Bug or Regression

- Grammar: access to function's return value without assigning it to a variable. These expressions were parsed as an error:
- `fun_obj(x) = h { h := {"a": {"b": [x,2]}} }`
- `aRule { a = fun_obj(1).a }` ([#59](https://github.com/open-policy-agent/opa-idea-plugin/pull/59), [@vgramer](https://github.com/vgramer))

# Release notes for v0.1.0

## Changes by Kind

### Refactoring

- Add tests on grammar and validate test files with `opa check` command ([#40](https://github.com/open-policy-agent/opa-idea-plugin/pull/40), [@irodzik](https://github.com/irodzik))
- Refactoring of Opa action codes and improve comment ([#38](https://github.com/open-policy-agent/opa-idea-plugin/pull/38), [@asadali](https://github.com/asadali))

### Feature

- Add the following opa action
- trace of selected text to code
- check ([#37](https://github.com/open-policy-agent/opa-idea-plugin/pull/37), [@frankiecerk](https://github.com/frankiecerk))
- Add the script to check that versioned source files (`*.java`; `*.kt`) contains the license header and call it in github action ([#49](https://github.com/open-policy-agent/opa-idea-plugin/pull/49), [@vgramer](https://github.com/vgramer))
- Build flavored ide. Some features like creating a rego project is only available on IDEA. This PR allows building the different flavors of the plugin for each ide version. This is transparent for the user (he see only one plugin market place) ([#44](https://github.com/open-policy-agent/opa-idea-plugin/pull/44), [@vgramer](https://github.com/vgramer))
- Grammar: add `%` operator and tests for grammar ([#39](https://github.com/open-policy-agent/opa-idea-plugin/pull/39), [@irodzik](https://github.com/irodzik))
- Implements auto-closing feature (brace, parenthesis and bracket ) ([#41](https://github.com/open-policy-agent/opa-idea-plugin/pull/41), [@vgramer](https://github.com/vgramer))
- Index TOTO in rego comment ([#26](https://github.com/open-policy-agent/opa-idea-plugin/pull/26), [@vgramer](https://github.com/vgramer))
- OpaTestRunConfiguration: add the full output of the command to the root node ([#52](https://github.com/open-policy-agent/opa-idea-plugin/pull/52), [@vgramer](https://github.com/vgramer))
- Support for opa test, test coverage on project workspace and opa check on current open document, shows output in console window (all support for console window showing output is in extensions/OPAActionToolWindow) ([#30](https://github.com/open-policy-agent/opa-idea-plugin/pull/30), [@frankiecerk](https://github.com/frankiecerk))

### Documentation

- Add opa icon for plugin installation ([#36](https://github.com/open-policy-agent/opa-idea-plugin/pull/36), [@vgramer](https://github.com/vgramer))
- Add user and tech documentation ([#3](https://github.com/open-policy-agent/opa-idea-plugin/pull/3), [@vgramer](https://github.com/vgramer))
- Instructions for download plugin from Jetbrains market place ([#48](https://github.com/open-policy-agent/opa-idea-plugin/pull/48), [@frankiecerk](https://github.com/frankiecerk))

### Bug or Regression

- Fix test run configuration:
- Don't discriminate test configurations based on the file name:
- user can eval or test a package in any rego file
- user can test any rule starting with `test_`in any rego file
- user can evaluate any rule not starting with `test_` in any rego file
- Make bundle dir parameter required to create a test configuration => avoid message `Testing Framework quit unexpectedly` when creating a test configuration from gutter
- Generated name of the runConfiguration start with the name of the command to easily know which configuration type will be generated ([#50](https://github.com/open-policy-agent/opa-idea-plugin/pull/50), [@vgramer](https://github.com/vgramer))
- Grammar: fixed string regex
highlighting for rule heads ([#19](https://github.com/open-policy-agent/opa-idea-plugin/pull/19), [@frankiecerk](https://github.com/frankiecerk))
Loading

0 comments on commit 4c0b308

Please sign in to comment.