Skip to content

A new report listing API versions that are old enough to be removed#3899

Merged
thomas11 merged 4 commits into
masterfrom
tkappler/old-versions-report
Jan 29, 2025
Merged

A new report listing API versions that are old enough to be removed#3899
thomas11 merged 4 commits into
masterfrom
tkappler/old-versions-report

Conversation

@thomas11

@thomas11 thomas11 commented Jan 28, 2025

Copy link
Copy Markdown
Contributor

Part of #3422. Determine API versions that are older than any previous default version in a module. These are good candidates for removal.

@thomas11 thomas11 self-assigned this Jan 28, 2025
@thomas11 thomas11 requested review from a team, EronWright and danielrbradley January 28, 2025 13:25
@github-actions

Copy link
Copy Markdown
Contributor

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@danielrbradley danielrbradley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall approach looks sensible 👍

The main algorithm could do with a couple of comments helping explain the rational of each major step.

Also, looks like there's a diff in the generated file in CI that we'll need to resolve.

Comment thread provider/pkg/versioning/gen.go Outdated
Comment thread provider/pkg/versioning/gen.go Outdated

@danielrbradley danielrbradley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, minor nit inline, also could add a line to the reports/README.md to explain the purpose of the new report.

Comment thread provider/pkg/versioning/gen.go Outdated
@thomas11 thomas11 force-pushed the tkappler/old-versions-report branch from aff35af to af0e097 Compare January 28, 2025 15:45
thomas11 and others added 2 commits January 28, 2025 16:46
@thomas11 thomas11 force-pushed the tkappler/old-versions-report branch from af0e097 to 748290f Compare January 28, 2025 15:46
@codecov

codecov Bot commented Jan 28, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 57.05%. Comparing base (9a92d17) to head (748290f).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
provider/pkg/versioning/gen.go 0.00% 31 Missing ⚠️
provider/pkg/versioning/build_schema.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3899      +/-   ##
==========================================
- Coverage   57.21%   57.05%   -0.16%     
==========================================
  Files          78       78              
  Lines       12436    12469      +33     
==========================================
- Hits         7115     7114       -1     
- Misses       4774     4808      +34     
  Partials      547      547              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v2.85.0.

thomas11 added a commit that referenced this pull request Jan 31, 2025
#3899 introduced a report of all API versions, per module, that are
older than the lowest default version of that module in the previous
major version. This PR takes that report for v2 -> v3 and merges it into
v3-removed.json, to remove these old API versions.

The size of the `sdk/` folder went from 3g to 1.4g on my machine.

Applying oldApiVersions.json to v3-removed.json was done with a little
program generated by Cursor:
```py
import json

# Load the JSON files
with open('reports/oldApiVersions.json', 'r') as old_file:
    old_versions = json.load(old_file)

with open('versions/v3-removed.json', 'r') as v3_file:
    v3_versions = json.load(v3_file)

# Merge the dictionaries
for key, versions in old_versions.items():
    if key in v3_versions:
        # Merge and sort the version arrays
        v3_versions[key] = sorted(set(v3_versions[key] + versions))
    else:
        # Add new key and versions
        v3_versions[key] = sorted(versions)

# Write the merged dictionary back to v3-removed.json
with open('v3-removed.json', 'w') as v3_file:
    json.dump(v3_versions, v3_file, indent=2)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants