Every yaml file in a project changed?

There is one commit in our version control that seems to be very odd. It appears every yaml file in the entire application changed. The changes appear to have been in taking long lines and wrapping them.

I am quite sure that I did not do this to 160+ files. Is this something anvil could have done?

It is wreaking havoc with our diffs.

1 Like

It is possible for the server to automatically add some “migration” commits when the app structure changes.

For example I see in many old apps a Automatically migrate old app features commit.

What is the comment on your commit?

From the Version history in the IDE:
Selected commit: Edited Form1, Form2, Form3 and 163 more

It also changed template.yaml in theme

Note, I changed the names of the forms in this post. I feel compelled to mention that I don’t have Form150 in my code :slight_smile:

If you change the name of a form, Anvil automatically updates the code wherever that form us referred, for example in imports.

The yaml can contain references to other form names which could be automatically updated.

What do you see in the yaml diff?

We did not do any renaming of forms that I could tell. In the template.yaml
It turned this:

    code: "from ._anvil_designer import $NAME$Template\nfrom anvil import *\n\nclass\
      \ $NAME$($NAME$Template):\n\n  def __init__(self, **properties):\n    # Set\
      \ Form properties and Data Bindings.\n    self.init_components(**properties)\n\
      \n    # Any code you write here will run when the form opens.\n    \n"

Into this:

code: "from ._anvil_designer import $NAME$Template\nfrom anvil import *\n\nclass $NAME$($NAME$Template):\n\n  def __init__(self, **properties):\n    # Set Form properties and Data Bindings.\n    self.init_components(**properties)\n\n    # Any code you write here will run when the form opens.\n    \n"

I was able to re-create this issue.

  1. Open any old project (I tried one that was two months old).
  2. Change the text of a label
  3. Go to Commit: Notice that settings, theme, and all the other yaml files are listed as changed

It’s entirely possible the format of the yaml files changed between those times, and in updating the old project Anvil also updated the yaml files to the new format.

Yeah, that is what we are thinking. In some cases, it was just multi-line to single line. In other cases, it was moving stuff around.

We got through the issue, but it was very unexpected to have everything change (I thought I had done something wrong).

That really trips up a conventional DIFF utility. It takes a hierarchy-aware DIFF to deal with some of those things. There are a few out there, including some in the Python Package Index. The latter may help if you need to automate the DIFF processing, e.g., to filter out false positives.

Same thing happened to me. I remember this happening a while ago. When I look at my diff in Anvil and nothing is showing up, I assume its a change in the YAML format

1 Like

Yeah, we pulled down the repo and confirmed it was all the yaml files.

1 Like