Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat: categorize changelog into Changed/Added/Removed/Fixed
Devin AIc09eb9180bdb
diff --git a/.github/resources/changelog-generator.py b/.github/resources/changelog-generator.pyindex 7dd8140eee..f6d54b3ee7 100644--- a/.github/resources/changelog-generator.py+++ b/.github/resources/changelog-generator.py@@ -12,7 +12,7 @@ import uuidREPO_OWNER = "infisical"REPO_NAME = "infisical"TOKEN = os.environ["GITHUB_TOKEN"]-SLACK_WEBHOOK_URL = os.environ["SLACK_WEBHOOK_URL"]+SLACK_WEBHOOK_URL = os.environ.get("SLACK_WEBHOOK_URL")OPENAI_API_KEY = os.environ["OPENAI_API_KEY"]SLACK_MSG_COLOR = "#36a64f"@@ -48,8 +48,9 @@ def post_changelog_to_slack(changelog, tag):raise Exception("Failed to post changelog to Slack.")def find_previous_release_tag(release_tag:str):+ tag_prefix = os.environ.get("TAG_PREFIX", "infisical/")previous_tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0", f"{release_tag}^"]).decode("utf-8").strip()- while not(previous_tag.startswith("infisical/")):+ while not(previous_tag.startswith(tag_prefix)):previous_tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0", f"{previous_tag}^"]).decode("utf-8").strip()return previous_tag@@ -129,33 +130,73 @@ def generate_changelog_with_openai(commit_details):commit_messages.append(base_message)commit_list = "\n".join(commit_messages)- prompt = """-Generate a changelog for Infisical, opensource secretops-The changelog should:-1. Be Informative: Using the provided list of GitHub commits, break them down into categories such as Features, Fixes & Improvements, and Technical Updates. Summarize each commit concisely, ensuring the key points are highlighted.-2. Have a Professional yet Friendly tone: The tone should be balanced, not too corporate or too informal.-3. Celebratory Introduction and Conclusion: Start the changelog with a celebratory note acknowledging the team's hard work and progress. End with a shoutout to the team and wishes for a pleasant weekend.-4. Formatting: you cannot use Markdown formatting, and you can only use emojis for the introductory paragraph or the conclusion paragraph, nowhere else.-5. Links: the syntax to create links is the following: `<http://www.example.com|This message is a link>`.-6. Linear Links: note that the Linear link is optional, include it only if provided.-7. Do not wrap your answer in a codeblock. Just output the text, nothing else-Here's a good example to follow, please try to match the formatting as closely as possible, only changing the content of the changelog and have some liberty with the introduction. Notice the importance of the formatting of a changelog item:-- <https://github.com/facebook/react/pull/27304/%7C#27304>: We optimize our ci to strip comments and minify production builds. (<https://linear.app/example/issue/WEB-1234/%7CWEB-1234>))-And here's an example of the full changelog:--*Features*-• <https://github.com/facebook/react/pull/27304/%7C#27304>: We optimize our ci to strip comments and minify production builds. (<https://linear.app/example/issue/WEB-1234/%7CWEB-1234>)-*Fixes & Improvements*-• <https://github.com/facebook/react/pull/27304/%7C#27304>: We optimize our ci to strip comments and minify production builds. (<https://linear.app/example/issue/WEB-1234/%7CWEB-1234>)-*Technical Updates*-• <https://github.com/facebook/react/pull/27304/%7C#27304>: We optimize our ci to strip comments and minify production builds. (<https://linear.app/example/issue/WEB-1234/%7CWEB-1234>)--Stay tuned for more exciting updates coming soon!-And here are the commits:+ output_format = os.environ.get("OUTPUT_FORMAT", "slack")++ if output_format == "github":+ prompt = """+Generate a changelog for Infisical, an open-source secrets management platform.++Using the provided list of merged PRs, categorize them under these headers (in this order, only include a category if there are entries for it):++### Changed+(changes in existing functionality)++### Added+(new functionality)++### Removed+(removed functionality)++### Fixed+(bug fixes)++Rules:+1. Every entry MUST be written in imperative mood, starting with a present tense verb (e.g. "Add", "Fix", "Remove", "Refactor", "Update", "Improve", "Support", "Document").+2. Every entry MUST be self-describing as if no category heading exists. Instead of "Support of CentOS", write "Support CentOS". Instead of "Documentation for read()", write "Document the read() method".+3. Each entry should be a single bullet point referencing the PR: `- Description (#PR_NUMBER)`+4. REMOVE non-interesting maintenance changes that are NOT useful to users. This includes: dependency version bumps, CI/CD pipeline config tweaks, minor typo fixes, build script changes, test-only changes.+5. Do NOT remove: refactorings, changes to supported runtime environments, code style changes that use new language features, new or updated documentation.+6. Stay consistent in phrasing across all entries.+7. Sort entries within each category by importance (most impactful first).+8. Do NOT include any introductory or concluding text. Output ONLY the categorized list.+9. Do NOT wrap the output in a code block.++Here are the merged PRs:{}- """.format(- commit_list- )+""".format(commit_list)+ else:+ prompt = """+Generate a changelog for Infisical, an open-source secrets management platform.++Using the provided list of merged PRs, categorize them under these headers (in this order, only include a category if there are entries for it):++*Changed*+(changes in existing functionality)++*Added*+(new functionality)++*Removed*+(removed functionality)++*Fixed*+(bug fixes)++Rules:+1. Every entry MUST be written in imperative mood, starting with a present tense verb (e.g. "Add", "Fix", "Remove", "Refactor", "Update", "Improve", "Support", "Document").+2. Every entry MUST be self-describing as if no category heading exists. Instead of "Support of CentOS", write "Support CentOS". Instead of "Documentation for read()", write "Document the read() method".+3. Each entry should be a single bullet point referencing the PR link: `• <PR_URL|#PR_NUMBER>: Description`+4. REMOVE non-interesting maintenance changes that are NOT useful to users. This includes: dependency version bumps, CI/CD pipeline config tweaks, minor typo fixes, build script changes, test-only changes.+5. Do NOT remove: refactorings, changes to supported runtime environments, code style changes that use new language features, new or updated documentation.+6. Stay consistent in phrasing across all entries.+7. Sort entries within each category by importance (most impactful first).+8. Do NOT include any introductory or concluding text. Output ONLY the categorized list.+9. Do NOT wrap the output in a code block.+10. Links: use the Slack link syntax `<http://www.example.com|This message is a link>`.++Here are the merged PRs:+{}+""".format(commit_list)client = OpenAI(api_key=OPENAI_API_KEY)messages = [{"role": "user", "content": prompt}]@@ -182,9 +223,11 @@ if __name__ == "__main__":# Generate changelogchangelog = generate_changelog_with_openai(pr_details)- post_changelog_to_slack(changelog,latest_tag)- # Print or post changelog to Slack- # set_multiline_output("changelog", changelog)+ if SLACK_WEBHOOK_URL:+ post_changelog_to_slack(changelog,latest_tag)++ if os.environ.get('GITHUB_OUTPUT'):+ set_multiline_output("changelog", changelog)except Exception as e:- print(str(e))\ No newline at end of file+ print(str(e))diff --git a/.github/workflows/generate-github-release.yml b/.github/workflows/generate-github-release.ymlindex 793031af6f..0795c014d4 100644--- a/.github/workflows/generate-github-release.yml+++ b/.github/workflows/generate-github-release.yml@@ -32,11 +32,12 @@ jobs:- name: Generate categorized changelogid: changelog- run: python .github/resources/release-changelog-generator.py+ run: python .github/resources/changelog-generator.pyenv:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}- RELEASE_TAG: ${{ github.ref_name }}+ TAG_PREFIX: "v"+ OUTPUT_FORMAT: "github"- name: Create GitHub Releaseuses: softprops/action-gh-release@v2diff --git a/.github/workflows/nightly-tag-generation.yml b/.github/workflows/nightly-tag-generation.ymlindex 9aaf6a2193..f8046d5399 100644--- a/.github/workflows/nightly-tag-generation.yml+++ b/.github/workflows/nightly-tag-generation.yml@@ -92,11 +92,12 @@ jobs:- name: Generate categorized changelogid: changelog- run: python .github/resources/release-changelog-generator.py+ run: python .github/resources/changelog-generator.pyenv:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}- RELEASE_TAG: ${{ env.NIGHTLY_TAG }}+ TAG_PREFIX: "v"+ OUTPUT_FORMAT: "github"- name: Create GitHub Releaseuses: softprops/action-gh-release@v2