[BUG] Publisher misses logger dependency in policy XML
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
Research direction
Start by tracing the publisher's policy XML dependency parsing and the existing handling for named values, policy fragments, and backend IDs. Add the logger reference to the dependency behavior described in the issue, then reproduce the Azure API Management publish with the supplied policy XML and verify that the logger is created before the policy.
Written by the indexing model from the issue text.
Description
Release version
v7.0.1
Describe the bug
Summary
When an API policy references a logger via log-to-eventhub logger-id="...", the publisher can attempt to PUT the policy before the logger resource exists in APIM. This results in a 400 validation error such as:
Logger not found
Root cause
The publisher builds dependency edges from parsed policy XML for things like:
- named values
- policy fragments
- backend IDs
but it does not currently parse logger references used in:
- log-to-eventhub logger-id="..."
As a result, the policy has no predecessor relationship to the logger, so parallel resource processing can PUT the policy before the logger resource has been created.
Expected behavior
When an API policy references an APIM logger in the XML policy, the publisher should create a dependency edge from that logger resource to the policy resource and publish the logger before the policy
Actual behavior
The publisher does not detect logger references in policy XML. As a result, the policy can be published in parallel with the logger, and APIM rejects the request with a validation error like:
Reproduction Steps
- Create or include an APIM logger resource, for example azureeventhublogger.
- Update an API policy that references that logger in XML, such as:
<policies>
<inbound>
<log-to-eventhub logger-id="azureeventhublogger" />
<base />
</inbound>
</policies>
- Run the publisher against the target APIM environment with that logger and policy in the artifacts (last commit)
- Observe that the publisher may PUT the policy before the logger is created.
- APIM returns 400 Bad Request with Logger not found for the policy.
- Dominant language
- C#
- Stars
- 448
- Forks
- 247
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/apiops
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/arrow-adbc#4809 ·
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/vscode-azurefunctions#5197 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
microsoft/microsoft-ui-reactor#1274 ·