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

Initial sync can use model methods #56

Conversation

aedificator-nl
Copy link
Contributor

@aedificator-nl aedificator-nl commented May 30, 2024

Fixes #55

The initial sync job now uses should_skip_webflow_sync? and webflow_collection_id methods from the model.

This way any adjustments to those methods (for example hardcoding a webflow_collection_id instead of using the slug) are used in the initial_sync_job as well.

Also includes a Rails upgrade. This does not seem to break anything, but was needed to get it working locally because of a lagging nio4r version.

Copy link
Owner

@vfonic vfonic left a comment

Choose a reason for hiding this comment

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

Impeccable! Thank you!

Let me see how I can have GitHub run the build and I'll release this as patch x.x.X version update. I think this could be considered as a bug fix rather than a feature addition.

Let me know if you believe differently.
I'll also try to upgrade to the newly released gem version from one of my Rails apps which are not on Rails 7.1.x to see if Bundler will try to update and fail or will it stay on the older version until I upgrade to Rails 7.1.x.

@@ -0,0 +1,2 @@
WEBFLOW_API_TOKEN=your_webflow_api_token
WEBFLOW_SITE_ID=your_webflow_site_id
Copy link
Owner

Choose a reason for hiding this comment

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

Thank you for adding these! 👍

actioncable (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
actioncable (7.1.3.3)
Copy link
Owner

Choose a reason for hiding this comment

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

We should probably upgrade to the lowest supported Rails version...but I don't do it myself either.
I'd leave it how you did it here (don't change anything). We can lower the required version if someone needs it (that could be me as I'm not using Rails 7.1 in any of the apps I'm working on)

@@ -54,7 +54,7 @@

context "when it shouldn't skip Webflow sync", vcr: { cassette_name: 'webflow_sync/should_skip_webflow_sync' } do
it 'returns false' do
expect(article.send(:should_skip_webflow_sync?)).to be false
expect(article.should_skip_webflow_sync?).to be false
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks! 👍

@vfonic vfonic closed this May 30, 2024
@vfonic vfonic reopened this May 30, 2024
@vfonic
Copy link
Owner

vfonic commented May 30, 2024

Can you please have a look and fix the build issue(s)?

Copy link
Owner

@vfonic vfonic left a comment

Choose a reason for hiding this comment

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

Looks like your RubyMine IDE files got checked in as well. Can you please remove them from the PR?

I have this in my ~/.gitignore_global:

*~
.DS_Store
.idea/*
.pry_history
.vscode/*

.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

/TAGS

*.code-workspace
TODO

I hope it helps.

@aedificator-nl aedificator-nl force-pushed the feature/initial-sync-should-use-model-settings branch from 9820488 to 276acd8 Compare June 4, 2024 06:55
@aedificator-nl
Copy link
Contributor Author

I have fixed some issues. The current issues with the test seem to have to do with the env vars, in test I think WEBFLOW_SITE_ID is set to <WEBFLOW_SITE_ID>, which errors out the tests. Could you replace this with an allowed dummy id?

@vfonic vfonic merged commit b7f49e9 into vfonic:master Jun 5, 2024
1 check failed
@vfonic
Copy link
Owner

vfonic commented Jun 5, 2024

I don't know how to allow PRs from forks to share Github Actions secrets. I tested your changes both locally and I pushed it to a branch on this repo and the build passed.

I released this as v9.0.0 due to many gems being updated due to security issues.
I don't mind bumping major version number (as you can tell) than breaking someone's app because it feel like the changes don't justify a major version bump.

@aedificator-nl aedificator-nl deleted the feature/initial-sync-should-use-model-settings branch June 6, 2024 07:36
@aedificator-nl
Copy link
Contributor Author

Thanks! Great that it all worked out!

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

Successfully merging this pull request may close these issues.

InitialSyncJob always uses find_collection_id from API instead of calling webflow_collection_id on model
2 participants