-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Changes to generate sdk changelog in releases.md and pr description #229
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
Changes from all commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
342f779
changes to test changelog in sdk-action
kanwardeep007 ba5c1de
log things in the sdk action regarding what files and content is gene…
kanwardeep007 f3be7e7
revert commit just LOGS
kanwardeep007 4d8536c
chore: log content of changelog after speakeasy run has been run
kanwardeep007 3e7dc3e
add more logging
kanwardeep007 03eb83f
chore: add logs
kanwardeep007 8f1d676
log mode
kanwardeep007 b5fe775
add different log
kanwardeep007 1cf9580
chore: add more logs
kanwardeep007 28608de
more logs
kanwardeep007 5d89c72
more logs
kanwardeep007 7274694
add changes to releases file. So that releases.md file is changed
kanwardeep007 de1e156
chore: add logs
kanwardeep007 d70a708
add log
kanwardeep007 53c1001
chore more logs
kanwardeep007 b4e6e09
fix bug
kanwardeep007 0d88024
more logs for debugging
kanwardeep007 cc141ee
chore more logs
kanwardeep007 132a89f
chore: fix the bug for generating releases
kanwardeep007 46758ac
chore
kanwardeep007 00db5bb
chore: Add more logs
kanwardeep007 4094340
chore: logs
kanwardeep007 2f16cd5
change sdk changelog in releases.md
kanwardeep007 be13e11
change rendering in releases.md
kanwardeep007 ec07a28
edit release message, also add tests. Now fix the commented tests
kanwardeep007 4041f6c
remove unnecessary logs and clean pr for review
kanwardeep007 1d2d060
use local speakeasy
kanwardeep007 e4277f6
refactor log statements and fix 1 test
kanwardeep007 89c802c
refactor method to generate release notes , make it easy to read
kanwardeep007 c01acf1
add comments
kanwardeep007 6d59d69
refactor: introduce sdkchangelog map in ReleasesInfo
kanwardeep007 74bcc68
remove unnecessary \n
kanwardeep007 9fc5c41
chore: fix tests, add parsing logic for language changelog to release…
kanwardeep007 eb4b5d2
update commit message with changelog release information
kanwardeep007 d8e47f5
gate sdk changelog, remove unnecessary code
kanwardeep007 f27ea6f
refacotr
kanwardeep007 1b3369d
new env variable, rename variable
kanwardeep007 2322765
fix bug by refactoring code to generate release info string format us…
kanwardeep007 c4f7fab
remove unused code
kanwardeep007 68fdc37
only generate for languages which are actually generated and rename e…
kanwardeep007 34dd0c1
adding new info for releases new format
kanwardeep007 9a829dd
rename stuff
kanwardeep007 c6d57f0
update pr with new content
kanwardeep007 6d6cc9c
chore: new pr description should be all hooked up properly
kanwardeep007 97fb393
use the new commit message when env variable is set. Fetch the messag…
kanwardeep007 ee209bf
reuse sorted languages
kanwardeep007 13a4297
adding new release_v2 which uses new content for release changelog
kanwardeep007 1ee9639
add tests for different languags
kanwardeep007 12c2546
add more details to tests
kanwardeep007 c2df581
changes that make code simpler
kanwardeep007 ae3838f
fix parsing and tests
kanwardeep007 995e5b9
fix tests and parsing in v2
kanwardeep007 3f3513f
add more resiliency to parsing
kanwardeep007 f0c7bff
Use the releases v2 for releases. add it behind env variable flag
kanwardeep007 a1d341b
add comment
kanwardeep007 4b4d2e7
get rid of sdk changelog that was inserted in v1 of releases. Now new…
kanwardeep007 895d7ff
same as previous message. take all new logic for v2 inside v2
kanwardeep007 5836035
make v1 like before undoing more changes
kanwardeep007 5776ce9
minor improvements
kanwardeep007 83af57b
remove comparison with zero value and use it as pointer
kanwardeep007 60079a7
remove commit headings
kanwardeep007 3bb7dc2
refactor code
kanwardeep007 7b2cab1
add comment
kanwardeep007 bc98a15
refactor
kanwardeep007 9dc407a
refactor code
kanwardeep007 36b92a0
refactor
kanwardeep007 2affd74
extract old pr creation into another method
kanwardeep007 f4cc194
refactor
kanwardeep007 07ee39f
refactor
kanwardeep007 5b3f51f
use new changelog for newer workflows using ge.lock
kanwardeep007 8abf089
refactor
kanwardeep007 304db2c
using sdk-gen-config containing release info for different targets
kanwardeep007 493cab5
bug. stopped writing file in original update release file method
kanwardeep007 6dfc8f9
use release notes from gen.lock file
kanwardeep007 8dfdf3b
remove releasesv2 because its not needed now
kanwardeep007 aa99366
add comments
kanwardeep007 5eae1bd
remove local sdk-config
kanwardeep007 945eaad
remove code for generating pr title. we use the old pr title
kanwardeep007 b982e04
add comments
kanwardeep007 53b9898
Fix the old message. There was some unintended spaces introduced. Als…
kanwardeep007 cb3d5ed
bug. old message had spaces fix them
kanwardeep007 97c7512
Fix spaces introduced by mistake in old message
kanwardeep007 0577a85
Starting changes based on thomas comments. New trajectory
kanwardeep007 e5048e2
use commit message using versioniong report
kanwardeep007 5ff7326
add comment
kanwardeep007 9364d27
use new changelogs driven by cli, and other refactoring
kanwardeep007 cb9b382
add comments
kanwardeep007 fda3c48
refactor remove releasesinfo which was not used in commit and push me…
kanwardeep007 8b1277d
remove unnecessary code and refactor log lines
kanwardeep007 e08bb12
remove code to fetch commit reports from disk. Instead extend version…
kanwardeep007 589781c
refactor code and use release notes from gen.lock when generating rel…
kanwardeep007 987b192
change commit message and add debug statement instead of info
kanwardeep007 a173fd7
refactor code and rename variables
kanwardeep007 afa971f
add logs for old flow
kanwardeep007 ff4455b
refactor code
kanwardeep007 61ca763
fix bug. use release notes (which is not string) from target
kanwardeep007 cb3f411
add comment and remove geninfo which was not used anywhere
kanwardeep007 aa13a22
refactor code
kanwardeep007 328a742
bug nil poiinter bug fix
kanwardeep007 3c79a41
refactor code and edit comments
kanwardeep007 73709b2
add comment in release action
kanwardeep007 2c3662c
remove unused code and add a comment in code
kanwardeep007 5a9440d
refactor
kanwardeep007 b902db1
make env variable more constrained
kanwardeep007 1b8ba7c
dead code
kanwardeep007 c6821bf
revert code changes that were not required and make it same as main b…
kanwardeep007 00e6d7b
Merge branch 'main' of https://github.com/speakeasy-api/sdk-generatio…
kanwardeep007 faf1fff
update go.mod
kanwardeep007 184fc89
REVERT THIS change before deploying
kanwardeep007 4992305
REVERt add custom message
kanwardeep007 b55b8e0
Revert "REVERT THIS change before deploying"
kanwardeep007 3533a92
CHANGING TAG
kanwardeep007 1a63e80
update action.yml
kanwardeep007 c2711b8
update tag version
kanwardeep007 9abf40f
chore: allow change to run on ryan repo
kanwardeep007 9d9b887
REVERT
kanwardeep007 6a0282f
change in pr reports
kanwardeep007 a267ba5
fix speakeasy cli line in PR
kanwardeep007 f94afc6
add ability to run the action in debug mode
kanwardeep007 46d08cc
Revert "add ability to run the action in debug mode"
kanwardeep007 5bcf931
set debug env to true
kanwardeep007 db8631f
REVERT all logs
kanwardeep007 e4fd968
add more logs
kanwardeep007 420c2f6
set flag based on environment
kanwardeep007 40ef830
update release body to contain necessary information
kanwardeep007 f809700
update release message
kanwardeep007 bf7bdf4
fortmat release message
kanwardeep007 4ea0748
remove log lines
kanwardeep007 6e8f2fe
logging changes
kanwardeep007 65809b8
Change back to v15 version
kanwardeep007 e94be28
remove logs
kanwardeep007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package actions | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
"strings" | ||
|
@@ -9,7 +10,6 @@ import ( | |
"github.com/pkg/errors" | ||
"github.com/speakeasy-api/sdk-generation-action/internal/utils" | ||
"github.com/speakeasy-api/sdk-generation-action/internal/versionbumps" | ||
"github.com/speakeasy-api/versioning-reports/versioning" | ||
|
||
"github.com/speakeasy-api/sdk-generation-action/internal/configuration" | ||
"github.com/speakeasy-api/sdk-generation-action/internal/git" | ||
|
@@ -102,6 +102,12 @@ func RunWorkflow() error { | |
anythingRegenerated := false | ||
|
||
var releaseInfo releases.ReleasesInfo | ||
runResultInfo, err := json.MarshalIndent(runRes, "", " ") | ||
if err != nil { | ||
logging.Debug("failed to marshal runRes : %s\n", err) | ||
} else { | ||
logging.Debug("Result of running the command is: %s\n", runResultInfo) | ||
} | ||
if runRes.GenInfo != nil { | ||
docVersion := runRes.GenInfo.OpenAPIDocVersion | ||
resolvedVersion = runRes.GenInfo.SpeakeasyVersion | ||
|
@@ -150,18 +156,18 @@ func RunWorkflow() error { | |
} | ||
|
||
if err := releases.UpdateReleasesFile(releaseInfo, releasesDir); err != nil { | ||
logging.Error("error while updating releases file: %v", err.Error()) | ||
return err | ||
} | ||
|
||
if _, err := g.CommitAndPush(docVersion, resolvedVersion, "", environment.ActionRunWorkflow, false); err != nil { | ||
if _, err := g.CommitAndPush(docVersion, resolvedVersion, "", environment.ActionRunWorkflow, false, runRes.VersioningInfo.VersionReport); err != nil { | ||
return err | ||
} | ||
} | ||
|
||
outputs["resolved_speakeasy_version"] = resolvedVersion | ||
|
||
if sourcesOnly { | ||
if _, err := g.CommitAndPush("", resolvedVersion, "", environment.ActionRunWorkflow, sourcesOnly); err != nil { | ||
if _, err := g.CommitAndPush("", resolvedVersion, "", environment.ActionRunWorkflow, sourcesOnly, nil); err != nil { | ||
return err | ||
} | ||
} | ||
|
@@ -184,6 +190,7 @@ func RunWorkflow() error { | |
OpenAPIChangeSummary: runRes.OpenAPIChangeSummary, | ||
GenInfo: runRes.GenInfo, | ||
currentRelease: &releaseInfo, | ||
releaseNotes: runRes.ReleaseNotes, | ||
}); err != nil { | ||
return err | ||
} | ||
|
@@ -207,10 +214,11 @@ type finalizeInputs struct { | |
LintingReportURL string | ||
ChangesReportURL string | ||
OpenAPIChangeSummary string | ||
VersioningReport *versioning.MergedVersionReport | ||
VersioningInfo versionbumps.VersioningInfo | ||
GenInfo *run.GenerationInfo | ||
currentRelease *releases.ReleasesInfo | ||
// key is language target name, value is release notes | ||
releaseNotes map[string]string | ||
} | ||
|
||
// Sets outputs and creates or adds releases info | ||
|
@@ -233,13 +241,14 @@ func finalize(inputs finalizeInputs) error { | |
} | ||
}() | ||
|
||
logging.Info("getMode from the environment: %s\n", environment.GetMode()) | ||
logging.Info("SDK_CHANGELOG_JULY_2025: %s", os.Getenv("SDK_CHANGELOG_JULY_2025")) | ||
switch environment.GetMode() { | ||
case environment.ModePR: | ||
branchName, pr, err := inputs.Git.FindExistingPR(branchName, environment.ActionFinalize, inputs.SourcesOnly) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
pr, err = inputs.Git.CreateOrUpdatePR(git.PRInfo{ | ||
BranchName: branchName, | ||
ReleaseInfo: inputs.currentRelease, | ||
|
@@ -272,11 +281,25 @@ func finalize(inputs finalizeInputs) error { | |
|
||
case environment.ModeDirect: | ||
var releaseInfo *releases.ReleasesInfo | ||
var oldReleaseInfo string | ||
var languages map[string]releases.LanguageReleaseInfo | ||
var targetSpecificReleaseNotes releases.TargetReleaseNotes = nil | ||
if !inputs.SourcesOnly { | ||
releaseInfo = inputs.currentRelease | ||
languages = releaseInfo.Languages | ||
oldReleaseInfo = releaseInfo.String() | ||
Comment on lines
+289
to
+290
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only languages and release content is needed when creating a release using CreateRelease method. Making this clear by changing the arguments in CreateRelease and passing in these arguments explicitly |
||
logging.Info("release Notes: %+v", inputs.releaseNotes) | ||
if os.Getenv("SDK_CHANGELOG_JULY_2025") == "true" && inputs.releaseNotes != nil { | ||
targetSpecificReleaseNotes = inputs.releaseNotes | ||
} | ||
|
||
// We still read from releases info for terraform generations since they use the goreleaser | ||
// Read from Releases.md for terraform generations | ||
if inputs.Outputs[utils.OutputTargetRegenerated("terraform")] == "true" { | ||
releaseInfo, err = getReleasesInfo() | ||
oldReleaseInfo = releaseInfo.String() | ||
targetSpecificReleaseNotes = nil | ||
languages = releaseInfo.Languages | ||
if err != nil { | ||
return err | ||
} | ||
|
@@ -289,7 +312,7 @@ func finalize(inputs finalizeInputs) error { | |
} | ||
|
||
if !inputs.SourcesOnly { | ||
if err := inputs.Git.CreateRelease(*releaseInfo, inputs.Outputs); err != nil { | ||
if err := inputs.Git.CreateRelease(oldReleaseInfo, languages, inputs.Outputs, targetSpecificReleaseNotes); err != nil { | ||
return err | ||
} | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.