Skip to content

Instantly share code, notes, and snippets.

@judell
Created August 20, 2023 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judell/3a58ae45f50f9cf03219258718f2f3f0 to your computer and use it in GitHub Desktop.
Save judell/3a58ae45f50f9cf03219258718f2f3f0 to your computer and use it in GitHub Desktop.
changelog summarizer prompt

Please write a Python-based changelog summarizer for a GitHub repo. Here is an example of the changelog format we are targeting.

data = """
## v0.115.0 [2023-08-08]

_Enhancements_

- Updated the `Makefile` to build plugin in `STEAMPIPE_INSTALL_DIR` if set. ([#1857](https://github.com/turbot/steampipe-plugin-aws/pull/1857)) (Thanks [@pdecat](https://github.com/pdecat) for the contribution!)
- Added column `offering_class` to `aws_pricing_product` table ([#1863](https://github.com/turbot/steampipe-plugin-aws/pull/1863)) (Thanks [@rasta-rocket](https://github.com/rasta-rocket) for the contribution!)

_Bug fixes_

- Fixed the `aws_ec2_network_load_balancer` table doc to remove the incorrect security group association example. ([#1869](https://github.com/turbot/steampipe-plugin-aws/pull/1869)) (Thanks [@
tinder-tder](https://github.com/tinder-tder) for the contribution!)
- Fixed `aws_rds_db_cluster`, `aws_rds_db_cluster_snapshot`, `aws_rds_db_instance`, `aws_rds_db_snapshot` tables to correctly filter out the `DocDB` and `Neptune` resources. ([#1868](https://github.com/turbot/steampipe-plugin-aws/pull/1868))

## v0.114.0 [2023-08-04]

_What's new?_

- New tables added
  - [aws_neptune_db_cluster_snapshot](https://hub.steampipe.io/plugins/turbot/aws/tables/aws_neptune_db_cluster_snapshot) ([#1866](https://github.com/turbot/steampipe-plugin-aws/pull/1866))

Notes about the format:

  • Each section begins like ## v0.115.0 [2023-08-08], and we'll want to capture both the version and the date

  • A section may have a subsection with a New tables added and sub-bullets that announce one or more new tables. In this case, there are two.

- New tables added
  - [aws_directory_service_certificate](https://hub.steampipe.io/plugins/turbot/aws/tables/aws_directory_service_certificate) ([#1836](https://github.com/turbot/steampipe-plugin-aws/pull/1836))
  - [aws_vpc_nat_gateway_metric_bytes_out_to_destination](https://hub.steampipe.io/plugins/turbot/aws/tables/aws_vpc_nat_gateway_metric_bytes_out_to_destination) ([#1842](https://github.com/turbot/steampipe-plugin-aws/pull/1842))
  • A section may have a subsection with bullets that announce enhancements. In this case there is one.
_Enhancements_

- Added the `event_topics` and `snapshot_limit` columns to the `aws_directory_service_directory` table. ([#1833](https://github.com/turbot/steampipe-plugin-aws/pull/1833))
  • A section may have a subsection with bullets that announce bug fixes. In this case, there are two.
_Bug fixes_

- Fixed the `aws_ec2_network_load_balancer` table doc to remove the incorrect security group association example. ([#1869](https://github.com/turbot/steampipe-plugin-aws/pull/1869)) (Thanks [@
tinder-tder](https://github.com/tinder-tder) for the contribution!)
- Fixed `aws_rds_db_cluster`, `aws_rds_db_cluster_snapshot`, `aws_rds_db_instance`, `aws_rds_db_snapshot` tables to correctly filter out the `DocDB` and `Neptune` resources. ([#1868](https://github.com/turbot/steampipe-plugin-aws/pull/1868))
  • A section can include either or both of Enhancements and Bug fixes, or may include neither.

  • We want to count Enhancements and Bug fixes for each section, and also sum them for a range of sections.

  • An Enhancements or Bug fixes subsection may include a thank you to an external contributor. The format might be either of:

(Thanks [@rasta-rocket](https://github.com/rasta-rocket)

(Thanks to [@srgg](https://github.com/srgg)
  • We want to capture a list of contributors' GitHub handles from each section (if any), and then produce a deduplicated list in the summary.

  • The summarizer considers sections within a window of recency. The -d (--days) argument is required, and defaults to 30 days. To summarize all sections we'd use a large number, for example -d 2000 ensures that all entries in the sample data (sample_data.py) will be included.

  • The script will be called changelog.py, and here are two sample runs for the sample data which is from the changelog for github.com/turbot/steampipe-plugin-aws.

$ python changelog.py -d 30
turbot/steampipe-plugin-aws
days: 30
{'new tables': 4, 'enhancements': 4, 'bug fixes': 4, 'contributors': ['pdecat', 'rasta-rocket', 'tinder-tder']}
$ python changelog.py -d 2000
turbot/steampipe-plugin-aws
days: 2000
{'new tables': 471, 'enhancements': 337, 'bug fixes': 166, 'contributors': ['LalitLab', 'Wade9320', 'aminvielledebatAtBedrock', 'brentmitchell25', 'gabrielsoltz', 'janritter', 'jaredreisinger-drizly', 'michael-ullrich-1010', 'nmische', 'pdecat', 'rasta-rocket', 'rinzool', 'srgg', 'tinder-tder']}

Write a script to process the data in sample_data.py, and write tests to prove that it produces these outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment