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

refactor: use schemapi from altair submodule #101

Merged
merged 2 commits into from
Aug 22, 2022
Merged

refactor: use schemapi from altair submodule #101

merged 2 commits into from
Aug 22, 2022

Conversation

manzt
Copy link
Member

@manzt manzt commented Jul 21, 2022

Prior to this PR, the code in tools/schemapi/* was copied from Altair. This PR adds Altair as a git submodule, and then imports the code from tools/altair/tools/schemapi.

I believe this is the "correct" way to keep things in sync with Altair (and allow us to pin versions if necessary), but perhaps it's overboard. Open to suggestions.

@manzt manzt changed the title feat: use schemapi from altair submodule refactor: use schemapi from altair submodule Jul 21, 2022
@manzt manzt requested a review from sehilyi July 21, 2022 15:16
Copy link
Member

@sehilyi sehilyi left a comment

Choose a reason for hiding this comment

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

I like the idea of using a submodule, more than the previous approach.

I think we can also consider pinning a specific branch of released Altair versions, such as v4.2.X which is dedicated for v4.2.0 and any future patches (they create a new branch when bumping a version). For example, we can run

git config -f .gitmodules submodule.tools/altair.branch v4.2.X

git submodule update --remote 

Changes on .gitmodules:

[submodule "tools/altair"]
	path = tools/altair
	url = https://github.com/altair-viz/altair.git
+	branch = v4.2.X

This way, I think we ensure that we track a stable version of Altair, and it is more clear which Altair version we use by seeing the .gitmodules file.

@manzt
Copy link
Member Author

manzt commented Jul 24, 2022

I think it should be find to track commits on the main branch, but I see you point.The git submodule doesn't follow a branch in realtime but pins a specific commit. You must manually run git submodule update to update to the latest commit on the branch it tracks.

The other thing is that this isn't really following a version of Altair, but a version of an internal dependency (schemapi) so I'm not sure if following semver for Altair makes sense (since the internals could theoretically change).

@sehilyi
Copy link
Member

sehilyi commented Jul 25, 2022

Yes, it makes sense to track a specific commit. I guess I wondered about (1) when to pull the updates from the submodule to this repo (e.g., whenever there is a major update on schemapi or a new Altair version release?) and (2) if the schemapi in the main branch can be considered a stable code. Since (I believe) schemapi in a specific branch (e.g., v4.2.X) is used for the released Altair, I think we can consider it to be stable and is dedicated for v4.2.0. But, given that schemapi is not updated that frequently (i.e., I see there are no updates since v4.2.0 in December last year), this does not matter that much.

@manzt
Copy link
Member Author

manzt commented Aug 22, 2022

I think I'm going to merge this for now, and we can pin a specific branch if it becomes an issue!

@manzt manzt merged commit 18ce7fb into main Aug 22, 2022
@manzt manzt deleted the manzt/submodule branch April 19, 2023 20:51
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.

2 participants