tarbell-project / tarbell

A Flask-based static site authoring tool.
https://tarbell.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
165 stars 32 forks source link

New project grabs old version of google sheet #446

Closed jonathonberlin closed 7 years ago

jonathonberlin commented 7 years ago

Hello,

When I create a new project and run through steps, everything appears good except I seem to be pulling in an old branch of our google sheet template. It's one generation old, missing a few tabs.

Where in the set-up is the relationship with the the template Tarbell inserts into the sheet and how can I change it to the correct branch?

tx,

Jonathon

eyeseast commented 7 years ago

Check the SPREADSHEET_KEY setting in tarbell_config.py in your project. It should match the key of your new sheet.

jonathonberlin commented 7 years ago

Thanks Chris!

I checked the key and that seems to be lined up. The way we have our blueprint built we put a spreadsheet template into the project's google sheet. that sheet has the fields we use to import into our cms.

That "template" sheet is what is outdated for me. Somehow I'm grabbing an old "template" when I create a new project.

Jonathon

eyeseast commented 7 years ago

Ah, I get what you're saying now. Check what branch your _blueprint directory is on. Tarbell clones it as a submodule, and older versions of Tarbell would try to switch to a branch matching Tarbell's major version (probably 1.0). If you cd _blueprint and run git status, that'll at least tell you if you're on an old branch, or maybe pinned to a commit. Assuming you're making changes on master, you can do git checkout master (from within the _blueprint directory) and get the right version.

See if that helps.

ghing commented 7 years ago

@jonathonberlin,

I'm guessing that someone updated the blueprint by changing the template spreadsheet, but committed their changes to the wrong branch, either 1.0 rather than master or vice-versa. Compare those two branches in the blueprint repo and merge any changes from the branch that is ahead into the other branch.

@eyeseast, with what version did Tarbell start just using master instead of the version branch for the blueprint?

@jonathonberlin, what version of Tarbell are you using? This should help clarify the branch issue.

Also check the blueprints defined in ~/.tarbell/settings.yaml and make sure the repository URL is correct for whatever blueprint you're choosing whenever you run tarbell newproject.

jonathonberlin commented 7 years ago

Thank you both!

jonathonberlin commented 7 years ago

I compared the spreadsheets in both branches 1.0 and master, and the 1.0 branch had the version of the spreadsheet I was looking for. I had the correct repository url in the settings.yaml but I'm not sure how to determine what branch of that repository is accessed when I create a new project. (I should say that my tarbell accesses the master branch if I were to judge by the spreadsheet issue -- what I mean is I don't know why that is or where in the process that relationship is determined)

As a workaround, I put the desired version of the _spreadsheet.xlsx in the master and committed that to the repo. Now I get the correct spreadsheet version when I create a new project, but it's possible that I may be missing other changes and just fixed one thing.

Curious: why does it matter which version of tarbell I am running and how can I make sure I'm using the right version for this issue?

Thanks again!!!

eyeseast commented 7 years ago

The latest version -- 1.0.7 -- will clone your blueprint on whatever you set as your default branch on Github. Before 1.0.5, Tarbell would clone the blueprint, then try to checkout its 1.0 branch (matching Tarbell's major version). This was a pain and led to lots of bugs.

The easiest fix, I think, is upgrading your global Tarbell install (sudo pip install tarbell from outside any active virtualenv). And then look at your blueprints on Github and make sure the default branch is master (or whatever you're committing to).