-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
airbyte-cron: update connector definitions from remote #16438
Conversation
try { | ||
return new AirbyteVersion(latestVersion).checkOnlyPatchVersionIsUpdatedComparedTo(new AirbyteVersion(currentVersion)); | ||
} catch (final Exception e) { | ||
LOGGER.error("Failed to check version: {} vs {}", currentVersion, latestVersion); | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing errors and a bootloader crash when updating definitions if any definition was not a valid semver. This would happen any time you've added a custom dev
version for testing, for example.
// todo (pedroslopez): Logic to apply definitions should be moved outside of the | ||
// DatabaseConfigPersistence class and behavior standardized | ||
final ConfigPersistence dbConfigPersistence = configRepository.getConfigPersistence(); | ||
final ConfigPersistence providerConfigPersistence = new DefinitionProviderToConfigPersistenceAdapter(definitionsProvider); | ||
dbConfigPersistence.loadData(providerConfigPersistence); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't want to spend much time on this since it wasn't the focus of this PR and I think the logic for applying version updates is going to change anyway, so I'm just calling the existing method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone isn't going to pick this up in the next few weeks, we should create an issue and link it here so we don't forget.
@Factory | ||
@Slf4j | ||
@SuppressWarnings("PMD.AvoidDuplicateLiterals") | ||
public class DatabaseBeanFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took heavy inspiration from the airbyte-workers micronaut migration for this, but I'm noticing the code is very very similar. Is there a way to share between the two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pedroslopez Yes...if we move any class that is annotated with Micronaut annotations to a library AND include the proper dependencies so that the annotation processor can find those classes during build time, the class will be automatically picked up by Micronaut at runtime from a library. I have done this in my airbyte-workers PR with the :airbyte-config:config-models module. I would also recommend doing this for the ApplyDefintionsHelper
, which can just have the annotations placed directly on it (e.g. @Singleton
).
I think we should plan on doing a sweep after we get everything working across the services in OSS.
airbyte-bootloader/src/main/java/io/airbyte/bootloader/BootloaderApp.java
Show resolved
Hide resolved
Hi @gosusnp / @jdpgrailsdev could I get confirmation that this is ok to merge via a review/approval? I have merged in the latest changes from master that remove the airbyte-worker dependency and my changes here are not affected. Note that I'm defining my own |
@pedroslopez I'm fine with merging this. We will want to do some cleanup later to avoid duplicating the configuration factory bits, but that shouldn't hold this up if we have confirmed that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces a new path for reading protocol versions which is missing some recent changes. I put the fix up in #16796
return new AirbyteVersion(latestVersion).checkOnlyPatchVersionIsUpdatedComparedTo(new AirbyteVersion(currentVersion)); | ||
} catch (final Exception e) { | ||
LOGGER.error("Failed to check version: {} vs {}", currentVersion, latestVersion); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably return true
might be a better behavior here. Typically, if the version is dev, I wonder if we shouldn't always try to refresh?
…vation * master: (26 commits) supply a source id for schema discovery in connector integration tests (#17662) Source Iterable: Add permission check for stream (#17602) Moving TrackingClientSingleton.initialize into the bean itself (#17631) Handle null workspace IDs in tracking/reporting methods gracefully (#17641) Bump Airbyte version from 0.40.11 to 0.40.12 (#17653) Revert "Do not wait the end of a reset to return an update (#17591)" (#17640) Standardize HttpRequester's url_base and path format (#17524) Create geography_type enum and add geography column in connection and workspace table (#16818) airbyte-cron: update connector definitions from remote (#16438) Do not wait the end of a reset to return an update (#17591) Remove redundant title labels from connector specs (#17544) Updated GA4 status support large schema discovery (#17394) 🪟 🐛 Fixes connector checks not properly ending their loading state (#17620) 🪟🧪 [Experiment] add hideOnboarding experiment (#17605) Source Recharge: change releaseStage to GA (#17606) Source Recharge: skip stream if 403 received (#17608) remove sonar-scan workflow (#17609) Mark/tables should be full width on all pages (#17401) Auto fail all workfow if there is a Versioning issue (#17562) ...
* add db connection injection to airbyte-cron * load definitions * fix patch version check for non-semver tags * apply helper tests * logging updates * fix remote definitions provider: add tombstones * docker compose env updates * add test for tombstone presence * rename helper class * config updates * dont use optionals as fields * use apply helper instead of directly calling load data in bootloader * avoid pmd warn * add docstring * sort docker compose env vars * updates for javax -> jakarta * clean up docker compose, update kube deployment env
What
closes https://github.com/airbytehq/airbyte-cloud/issues/2542
Adds functionality to update source and destination definitions from the remote catalog at runtime, on an interval.
This builds on the remote definitions provider introduced in #16018
How
UPDATE_DEFINITIONS_CRON_ENABLED
env var to turn on / off these updatesAlso fixed a couple of things while in here:
Recommended reading order
ApplyDefinitionsHelper
DefinitionsUpdater
🚨 User Impact 🚨
This will be off by default on OSS, so no impact.