Skip to content
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

[BUG] PUBLISH_CONFIGURATION_ARTIFACTS setting is ignored #417

Closed
andrea-migliaccio opened this issue Nov 14, 2023 · 4 comments
Closed

[BUG] PUBLISH_CONFIGURATION_ARTIFACTS setting is ignored #417

andrea-migliaccio opened this issue Nov 14, 2023 · 4 comments
Labels
question Further information is requested

Comments

@andrea-migliaccio
Copy link

Release version

v4.10.3

Describe the bug

The documentation at publisher doc states that we can use the following variable to specify which artifacts actually publish from the whole /artifact folder in the git repo.

PUBLISH_CONFIGURATION_ARTIFACTS = If set to true, publisher will publish artifacts that are defined in configuration and exist in the artifacts directory.

Based on a failed test and actually taking a look at the code, it seems that this variable not even read from the code.

Expected behavior

When specifing both CONFIGURATION_YAML_PATH and PUBLISH_CONFIGURATION_ARTIFACTS the publish operation should only take in account the resources specified in the yaml configuration file.

Actual behavior

The CONFIGURATION_YAML_PATH just affect the values override but all the resources in the /artifact folder are always published.

Reproduction Steps

  1. Extract from a source APIM a bunch of resources
  2. Prepare a publisher configuration file that just specifies one of them
  3. Configure the publish pipeline with both the CONFIGURATION_YAML_PATH and PUBLISH_CONFIGURATION_ARTIFACTS=yes
  4. run the pipeline
Copy link

  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.

@andrea-migliaccio andrea-migliaccio changed the title [BUG] [BUG] PUBLISH_CONFIGURATION_ARTIFACTS setting is ignored Nov 14, 2023
@waelkdouh waelkdouh added the question Further information is requested label Nov 14, 2023
@waelkdouh
Copy link
Contributor

@andrea-migliaccio good catch. At one point we enabled a feature on the publisher to allow it to pick up changes in the configuration file. This led to some complexities so we had to revert it back. We just forgot to update the docs. I will go ahead and take care of it right now.

@zcarroll4
Copy link
Contributor

zcarroll4 commented Dec 19, 2023

@andrea-migliaccio good catch. At one point we enabled a feature on the publisher to allow it to pick up changes in the configuration file. This led to some complexities so we had to revert it back. We just forgot to update the docs. I will go ahead and take care of it right now.

With this parameter no longer being available, how can we differentiate the resources per region? We were planning on using the config file to specify the different resources per region. (resource-dev,resource-qa, resource-prod)

Update
So, it looks like the CONFIGURATION_YAML_PATH -> config file where we can overwrite is still in place. So does this PUBLISH_CONFIGURATION_ARTIFACTS just now default to true?

@guythetechie
Copy link
Contributor

@zcarroll4 - as you mentioned, the CONFIGURATION_YAML_PATH variable still works and is used for overrides.

Regarding PUBLISH_CONFIGURATION_ARTIFACTS, here is the old behavior.
image

In the current behavior, configuration artifacts are purely used for overrides:

If no commit ID is passed

We take all artifacts from the artifacts folder. They get overridden with configuration properties if applicable, then published to APIM.

If a commit ID is passed

We take all artifacts in the artifacts folder that were modified in the commit. Deleted artifacts get deleted from APIM. New/modified artifacts get overridden with configuration properties (if applicable), then published to APIM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants