[Beta] Where are the Publish and Unpublish buttons?

In the classic editor there is a Publish and an Unpublish button on every commit.

I was not able to find the equivalent in the new beta editor.

I tried clicking and right-clicking on a commit in the version history panel, but I haven’t seen anything that resembles the old buttons.

I understand that the new editor is able to manage multiple branches, but I was expecting to see them side by side with the default simple behavior.

Right now I have done some changes to an app and want to publish. With the classic editor it would have been two clicks: view history, then publish.

What am I supposed to do with the new editor?

Top right corner of the page next to your profile button.

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.

Hi folks,

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!

3 Likes

I don’t understand.

Here is how I understand the old version:

  • In the classic editor apps have a master branch and each commit has 2 buttons publish and unpublish
  • The publish button deletes the published branch if it exists and creates a new one on the selected commit
  • The unpublish button only deletes the published branch
  • The published version of the app runs either on the published branch of it exists, otherwise on the master

I understand how to accomplish the same with the new management of branches and environments, but I’m asking where the old one-click solution is.

In most cases the old development / production model with 1 optional published branch, managed by two buttons, works just fine.

Have we lost that?

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.

How do you click publish?

The documentation shows a publish option in the context menu:

image

But I don’t have it:

image

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.

Or am I missing something?

No, you’re not missing anything! As I mentioned above, simplified publishing will be coming to the Beta Editor soon :slight_smile:

2 Likes

I am completely confused on this.

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.

1 Like

Yeah, I might have to do that.

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:
firefox_5xAy9HKK0q

  1. while on “master”, click commit
  2. change branch to “published”
  3. right-click on last commit
  4. choose “Reset published branch to here” (reset sounds like we’re zapping away our published branch history…)

OR

  1. choose “Merge” and in the popup we see we’re merging INTO published branch

What’s the correct way to publish?

As @stefano.menci noted, I cannot see any “Publish” menu voice either.

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.

1 Like

I absolutely agree.

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.

I wonder if part of the disconnect is that the new editor is envisioning the master branch as the published/deployed branch (see also the “Publish Your App” image here), using other branches for development/testing, whereas previously master was referred to as the “Dev” branch.

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.

3 Likes

I agree.

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.

2 Likes

What you could do is:

  1. Create a new dev branch where the old master is.
  2. Reset master to where the (old) published branch is.
  3. 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.)
  4. 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:

1 Like

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.