Skip to content

Conversation

@MyoungHaSong
Copy link

This PR fixes a data accuracy bug by populating the package_classification attribute in two OS Management Hub data sources. The attribute
was defined in the schema but was not being set, returning a null value to users.

Fixes #2457

Description of Change

The package_classification attribute is now correctly populated for the following data sources:

  • oci_os_management_hub_managed_instance_installed_packages (set to "INSTALLED")
  • oci_os_management_hub_managed_instance_updatable_packages (set to "UPDATABLE")

Rationale

The root cause was a FIXME left by the code generator. The OCI Go SDK's PackageSummary type is polymorphic, and the
packageClassification field is a discriminator that is not exposed as a readable struct field. This caused the generator to fail, and the
line was commented out.

The solution follows the established pattern in the available_packages data source by setting the appropriate hardcoded constant based on
the context of the data source.

Testing

  • All local builds and unit tests pass (make build, make test).
  • Added resource.TestCheckResourceAttr assertions to the acceptance tests for both affected data sources to verify the attribute is
    populated correctly and prevent future regressions.

…urces

Fixes missing package_classification in InstalledPackageSummary and
UpdatablePackageSummary data sources.

Changes:
- Set package_classification to INSTALLED in installed_packages
- Set package_classification to UPDATABLE in updatable_packages
- Add test assertions for classification values

The OCI SDK adds PackageClassification only during JSON marshaling as a
discriminator. Following available_packages pattern, we set the appropriate
constant based on concrete type.

Fixes oracle#2457

Signed-off-by: danny.song <[email protected]>
@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Oct 9, 2025
@tf-oci-pub tf-oci-pub added the Pending Test Pending Test label for PRs label Oct 17, 2025
@tf-oci-pub
Copy link
Member

Thank you for your valuable contribution. We greatly appreciate your efforts in submitting this pull request. However, I regret to inform you that we are unable to merge it directly on GitHub at this time.

Our internal policy requires that all pull requests undergo thorough local testing and review before they can be merged into the main codebase. This process ensures the quality and stability of Terraform-Provider-OCI.

We understand that this may cause some inconvenience, but please rest assured that your contribution is highly valued. Our team will carefully review and test your changes locally to ensure they meet our standards.

We appreciate your understanding and patience in this matter. If you have any questions or need further assistance, please don't hesitate to reach out. Thank you once again for your contribution.

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

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. Pending Test Pending Test label for PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OS Management Hub: package_classification attribute missing from package data sources

2 participants