The Publish button in the new editor isn’t exactly the same as the old one it seems. It allows you to specify which branch(es) will be published and where.
To actually publish a commit from the master branch (or any other version system you want to come up with) you can merge your commit into the published branch.
Here is the relevant docs page:
I’m still getting used to it myself, and honestly I’m not a big fan of Git. It’s powerful and also powerfully unintuitive.
We’re aware that the one-click publish workflow is currently slightly harder in the Beta Editor. Now that we’ve got the full functionality nailed down, we’re going to be working on exposing the common cases. Watch this space!
I also couldn’t figure out how to do the old one-click solution. If you are on master and click publish you might expect it to merge master into published and you are done.
I am still not able to publish my changes on the beta editor.
I understand how to configure new environment and create branches. I created a new app, I spent some time to configure it and it works. But that feels like a step backwards compared to the old one-click solution.
For my existing apps the fastest way is to switch to the classic editor, clicked publish or unpublish, then switch to the new beta editor.
For the new apps I will need to spend some time at the beginning to configure my branches and environments and then think every time I need to publish something.
The old way didn’t require any thinking, just one click. In simple single-developer apps was better.
I have made some changes, and they appear to be in the “master” branch. I want to make that version the “published” version, replacing the current published version.
I can see no way to do it. Please help.
I tried merging by it said there was nothing to merge.
If you want the old one-click workflow you can switch to the old editor and publish from there.
That’s the easiest way while we wait for the next magic touch.
I think I get the workflow now for future changes, I just don’t know how to publish my current master branch for the changes I’ve already made.
If anvil central can point me in the right direction to save me going back to the old editor, I’d like to try and sort it in the new one.
edit - oh, I right clicked the master and it came up with a menu offering to “reset the published branch to here”. It definitely didn’t do that earlier. i think that’s done it.
edit 2 - What I did was I created a new branch from the Master called “v03”. After some idle clicking about that list (left and right) that menu appeared and has solved my problem. I’d like to know what I should have done, coz I’m not sure I can reliably reproduce what I did …
I am lost too at pushing modifications to published version.
What are the correct steps?
I found these, but I ask Anvil Central if this is the correct sequence.
Ok let’s assume I modify my code.
Old IDE: Save version → Publish
New IDE:
while on “master”, click commit
change branch to “published”
right-click on last commit
choose “Reset published branch to here” (reset sounds like we’re zapping away our published branch history…)
OR
choose “Merge” and in the popup we see we’re merging INTO published branch
Ian, while I wait for the simplified one-click publishing, I tried working with the branches and environments. I followed these steps and it worked:
select master as the editing branch
edit, then, when I’m happy with my creation…
select published as the editing branch
right click on the master branch, then merge → the Merge into published dialog opens
type a commit message
click merge
The problem is that at this point published is the editing branch, and I risk to, well, edit it. Which is a big no no.
It would be nice to have a Make branch read-only checkbox while defining the environments, so I could set the published branch as read-only and the only way to edit it will be with a merge. Which is not going to happen by accident.
Part of the problem here is that “merge” is a woefully incomplete word by itself. It’s missing the critical “from” and “to”. If I right click on object X, and get a menu item that says simply “merge”, I don’t know which way the information is flowing, nor what’s going to change.
I was going to ask for this and complain that not even the “Merge into published” dialog contains that piece of information, when I realized that half of that information is in the dialog title itself.
Better than nothing: there is the to part, not the from part and you only see it after you click on it, but I agree, it should be more clear.
My understanding is that this is consistent with typical git conventions, so I like this change. But it will require a mindset shift for those of us who have mostly only developed software on Anvil, and it may be awkward for preexisting projects making the transition to the new editor.
edit: I now see that the last section of the new Version Control docs suggests using a production branch akin to the old published branch, so the Beta Editor will presumably support that workflow, as Ian seemed to indicate above.
On top of the mindset change, there is the way the existing apps work. The problem is that this change, as you say, is switching existing apps upside down.
I would need to rename the old master to development and the old published to master, which (I think) it’s impossible from the editor.
Reset master to where the (old) published branch is.
In the Environments menu, change the Default/published App Version to link to the (new) master branch. (Note: This step seems to require migrating your app to Environments, disabling related functionality in the Classic Editor.)
Delete the published branch to avoid confusion.
The only hitch I ran into when trying this is that the new editor is still hardwired to refer to master as “the latest version” in the Environments dialog, contrary to my hypothesis above:
Following these steps you end up with a one-click publish: you always work on the dev branch and when you are ready you click on Merge changes into master.
You can’t unpublish, but you get all the goodies from the enhanced git management.