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

Disable JobHosting workers for disabled jobs #4752

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mikaelweave
Copy link
Contributor

@mikaelweave mikaelweave commented Dec 10, 2024

Description

  • Adds method to disable JobHosting queues for export and import if they are disabled or have no storage account configured.

Related issues

AB#134785

Testing

  • Added tests
  • Debugged during startup to confirm behavior.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@mikaelweave mikaelweave requested a review from a team as a code owner December 10, 2024 21:33
@mikaelweave mikaelweave changed the title Personal/mikaelw/disable job workers for disabled jobs Disable JobHosting workers for disabled jobs Dec 10, 2024
@mikaelweave mikaelweave added this to the S156 milestone Dec 10, 2024
@mikaelweave mikaelweave added Bug Bug bug bug. Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs labels Dec 10, 2024
/// <summary>
/// Removes queues based on the enabled status of the operations.
/// </summary>
public void RemoveDisabledQueues()
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a silly question, why do we add them then remove instead of skipping to add?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought the same thing initially. 😆 The main reasoning is this approach allows default configuration applied in appsettings.json which is parsed to the configuration objects. I think this is the correct approach vs applying overrides via environment variables/appsettings overrides in the hosting environment which have to be maintained separately.

So once we parse the defaults into the configuration class, why have the removal logic here? I'm thinking keeping it in this class encapsulates the logic here vs polluting the registration classes with operation specific logic. It just exposes a hook to be called.

I was on the fence about implementation on this - happy to change the approach if there are thought a different direction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brendankowitz - I could use a custom ConfigurationProvider instead like below. Thoughts?? I think this would intercept the configuration of the class.

public class DictionaryExpansionConfigurationProvider : ConfigurationProvider

Copy link
Member

Choose a reason for hiding this comment

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

In thinking about it, perhaps this is calling more to consolidate these settings into one place. Right now we enable/disable in one place, configure job settings in another and remove as a post step. It might make more sense to move all these into a single config which would make this more discoverable / maintainable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants