-
Notifications
You must be signed in to change notification settings - Fork 368
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
Ability to diff between local and remote theme files #697
Comments
I support this too. Or similarly a way to tell |
Related - #330 Detecting remote changes to theme I don't think that's likely to be a native feature(see below), shorterm I think the solution is some docs on workflow(git commands) &deployment strategies with simple scripts and cli aliases, and tools for some editors to automate more of the micro decisions(such as piping recently changed files as a list to So any native command like -diff could just be an alias, or workflow sugar.
Pseudo
A script setting could be similar to npm's run command so instead of Though a big failure point is if git isn't being used then basically the only sane way this would still work is for any download to happen in a different directory so the working directory doesn't get clobbered ,which makes me think that might be a seperate issue to check for that anyway AFAIK there are several things preventing such a diff feature from being a hard part of themekit:
|
We are currently working on something to ease this, I cannot say much about it but it is a work in progress. |
@tanema awesome! I don't have bandwith to try and formalize what I've outlined above into something consumable. |
We just released v1.1.0. We have just released a checksum value in the asset API (in the unstable api version) and so we have enabled themekit to now only perform actions that are necessary. This means that you can now run However we have also put this functionality into watch and deploy. This means when you are deploying, it will only upload files that have changed, and maybe this will cut down some of the reasons why you wanted a diff command. Hopefully these extra features have mitigated some of your needs but either way I look forward to your feedback on the new features! |
Sounds great @tanema ! Definitely have mitigated some, but having the checksum in the assets API means there's at least a pathway to providing a diff feature, I think. |
I think the changes mostly from #745 stemming from #714 and other checksum pulls Great! at least getting only necessary files in a remote theme should speed up sync and diff workflows instead of downloading everything. Though for the Is there an override|force|hard(opposite --soft)? to skip checksums? @tanema How does shopify envision themekit's role in workflows such as Diff and syncs? With Diff, it's easy to assume a user's who's diffing is advanced enough to know they need to be:
My Blah blah Regardless of a diff specific feature, I think the meta problem here is themekits workflows don't enable making informed decisions about changes in advance as the common commands are inherently all or nothing and assumes users are knowledgeable enough to prevent wiping out their work. For beginners like designers, or merchants, tools like this being clinical often mean a painful first-time lesson about file handling & backups. I guess mostly it's a sentiment where it seems fragile and error prone to be required to first write entire files and to then be able to decide if that was the wrong irreversible choice. I can't even count the number of times i've forgotten to ignore settings_data.json. But really it takes magic for themekit to know user intent and either create a temp dir, or integrate with git to stash any possible local overwrites, and know whether to copy or download the entire theme for the purposes of reconciling distributed file changes. DIFF Workflow examples (using meld)Multiple DirectoriesAFAIK currently the simplest way to work safely with only themekit and a difftool requires using a different directory either through separate cli's, the themekit flag Windows command line:
[1] themekit will not create a new folder with it's --dir flag it will raise an error Notes: GIT with a single directoryUsers of GIT have more setup steps but get more choices, so as long as local changes are preserved either by commit or stash commands. Then users can safely get whatever themekit downloads for comparing the dirty working directory to the current branch and commit changes. Or "undo" using several options provided by GIT:
|
@tanema do you have any rough ETA on when this would be implemented with node-themekit as well? |
@dan-gamble We should have the node-themekit update out in the next day or two. |
Thanks for the update @andyw8! |
hello, will this feature also be available for "theme deploy" ? We want to use Github actions for automatic deployment, but there is no way if we "force" the client to "not" install any apps related to changes in the theme. |
@mrpacman101, the live theme is like a remote pull from an untracked
multi-collaborative gitless repo you can never rely on to document itself.
Typically when using version control you'd first run theme download on the
target theme(production) to merge any upstream changes into your repo
before running theme deploy.
If you think the sync will be a real problem, give it it's own branch first.
Then just figure out how you want to commit the changes, or resolve
conflicts.
Either as one blob , as categorical commits(settings, locales, media
assets, per app changes, analytics etc),
*or more excessively go granular where you're documenting each change.*
For the syncs commit line, or branch, I've been using a format of *YYYY-MM-DD
sync - category(optional) - remote [LIVE] to local [DEV] - reason(optional)*
.
where [LIVE] and [DEV] try to be tags on the theme names but not always.
Along with other common situational themes like [SWING] [Backup], or
tagged with another developer|agencies name.
Then only add notes to the commit body if there's non normal weirdness and
I had to make the commit line long.
As *syncing *is the reason , *reason *is to differentiate similar commits
for the history but I never use it to keep commit line short.
…On Wed, Dec 23, 2020 at 4:36 PM Mark ***@***.***> wrote:
hello, will this feature also be available for "theme deploy" ?
We are facing a lot of issues - manually diff remote and local theme
version, when Client installs apps or creates custom templates. When i run
theme deploy - remote files will be deleted, would it not be better to not
delete remote created files?
This would solve so many issues when clients install apps, snippets etc
via app autoinstaller.
We want to use Github actions for automatic deployment, but there is no
way if we "force" the client to "not" install any apps related to changes
in the theme.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#697 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALIKKMLH5O5TOBA3KSCX3Q3SWJPF7ANCNFSM4LDDBGHQ>
.
|
@PaulNewton Maybe i will come up with a small github actions script which would take care of this process. I wonder how other agencies solves this - do they all just use their own custom scripts for continues deployment? Any other tools i might need to look out for like - anyone experienced using this with Beanstalk? |
Is your feature request related to a problem? Please describe.
We manage our theme codebase in a repo, and often when installing new apps those new apps add new files to the remote theme. It would be great to see what is new and different on the remote compared to the local to understand what to download from the remote to include in the repo.
Also when doing a full theme deployment via
theme deploy --env=<name of env>
that command will remove any files from the remote that aren't included in the local. Before doing atheme deploy
it would make sense for a developer to sanity check for any missing files on their local by first using atheme diff
.Additionally, when sharing development between other developers, it'd be great to see the difference between a local branch versus the remote theme, in case other developers have made changes and haven't communicated them within the team.
Describe the solution you'd like
theme diff [--env=<name of environment>] [--compare-to-env=<name of environment>] [--show-only-missing]
This command would produce a list of files where the local theme differs from the remote, e.g.:
The theme diff output would only list files which have differences:
Additionally to diff between two remotes could be interesting too:
The option to show only missing files could be interesting:
Describe alternatives you've considered
Currently have been downloading the theme code and then locally comparing branches. It's quite slow to download, and extra manual actions to have to perform the diff locally.
Additional context
Code version software routinely uses diffs for managing changes between commits and branches.
Having the ability to diff between the local and remote version of a theme means the theme developer could quickly see what differences there are, and if they need to download any changes to their local before they do a
theme deploy
command and potentially break the site.The text was updated successfully, but these errors were encountered: