Skip to content

Conversation

@yfougeray-euphoria
Copy link
Contributor

Resolve #146

@paul-botsco-2-0 paul-botsco-2-0 bot added the 😍 cla signed The CLA is signed label Nov 6, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@madpah madpah changed the title handle import for apt repositories feat: support import for sonatyperepo_repository_apt_* resources Nov 6, 2025
@madpah madpah added the enhancement New feature or request label Nov 6, 2025
} else {
// Set default values when API doesn't provide replication data
m.Replication = &RepositoryReplicationModel{
PreemptivePullEnabled: types.BoolValue(false),
Copy link
Contributor

Choose a reason for hiding this comment

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

Extract false to a common constant and use in schema please @yfougeray-euphoria

}

// DoImportRequest implements the import functionality for APT Hosted repositories
func (f *AptRepositoryFormatHosted) DoImportRequest(repositoryName string, apiClient *sonatyperepo.APIClient, ctx context.Context) (any, *http.Response, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not call the DoReadRequest function that exists already? This looks like code duplication...

}

// DoImportRequest implements the import functionality for APT Proxy repositories
func (f *AptRepositoryFormatProxy) DoImportRequest(repositoryName string, apiClient *sonatyperepo.APIClient, ctx context.Context) (any, *http.Response, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not call the DoReadRequest function that exists already? This looks like code duplication...

}

// ValidateRepositoryForImport validates that the imported repository is indeed an APT Hosted repository
func (f *AptRepositoryFormatHosted) ValidateRepositoryForImport(repositoryData any, expectedFormat string, expectedType RepositoryType) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't see ValidateRepositoryForImport being called from anywhere @yfougeray-euphoria ?

return *apiResponse, httpResponse, nil
}

// ValidateRepositoryForImport validates that the imported repository is indeed an APT Proxy repository
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't see ValidateRepositoryForImport being called from anywhere @yfougeray-euphoria ?

@yfougeray-euphoria yfougeray-euphoria marked this pull request as draft November 7, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request 😍 cla signed The CLA is signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support import for sonatyperepo_repository_apt_* resources

2 participants