Skip to content

refactor(image): move image data sources to Plugin Framework#1448

Merged
jooola merged 4 commits into
mainfrom
plugin-framework-image
Jun 11, 2026
Merged

refactor(image): move image data sources to Plugin Framework#1448
jooola merged 4 commits into
mainfrom
plugin-framework-image

Conversation

@jooola

@jooola jooola commented Jun 4, 2026

Copy link
Copy Markdown
Member

Related to #752

@jooola jooola requested a review from a team as a code owner June 4, 2026 14:31
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.50311% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.15%. Comparing base (83c0bfd) to head (78aeb61).

Files with missing lines Patch % Lines
internal/image/data_source.go 73.36% 33 Missing and 16 partials ⚠️
internal/image/data_source_list.go 83.00% 9 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1448      +/-   ##
==========================================
+ Coverage   73.00%   73.15%   +0.15%     
==========================================
  Files         113      115       +2     
  Lines       12639    12751     +112     
==========================================
+ Hits         9227     9328     +101     
- Misses       2343     2344       +1     
- Partials     1069     1079      +10     
Flag Coverage Δ
e2e 73.15% <79.50%> (+0.15%) ⬆️
unit 37.80% <42.23%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from datasource-get-one to main June 4, 2026 22:07

@apricote apricote left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀

Comment thread internal/image/data_source.go
@jooola

jooola commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

The upgrade tests are failing, because of a difference between the versions. Some of the diffs are expected, but some other I don't know if we want fix the values or stay backward compatible at all costs.

// Image list
                  ~ images             = [
                      ~ {
                          ~ deprecated   = "" -> null
                            id           = 40093059
                            name         = "lamp"
                          - selector     = ""
                            # (8 unchanged attributes hidden)
                        },

// Image single
                    id                 = 161547269
                  ~ include_deprecated = false -> null
                    name               = "ubuntu-24.04"
                  ~ with_architecture  = "x86" -> null
                    # (13 unchanged attributes hidden)

For the users provided options, I think its fine to change them.

For the deprecated attribute I am unsure if we still want to roll with this fix.

@apricote

apricote commented Jun 8, 2026

Copy link
Copy Markdown
Member

I think the shown changes are fine, all are basically the same in the terraform type system.

For the with_architecture diff: It looks to me like you missed the default in the new schema. This should be set for backwards compatibility.

@jooola

jooola commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

For the with_architecture diff: It looks to me like you missed the default in the new schema. This should be set for backwards compatibility.

Data sources do not support defaults. I was only able to document the defaults in the markdown description, and set the default in the code directly.

I'd argue because it is a user input used to filter the result, it is fine to have null when it is unset.

@jooola jooola force-pushed the plugin-framework-image branch from 5387c1e to 78aeb61 Compare June 10, 2026 14:40
@jooola jooola merged commit 531f49e into main Jun 11, 2026
11 of 15 checks passed
@jooola jooola deleted the plugin-framework-image branch June 11, 2026 11:17
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.

2 participants