Opened on 03/15/2017 at 11:03:04 AM
Closed on 04/04/2017 at 08:51:25 AM
#4992 closed change (fixed)
Generate website from the master bookmark [CMS]
Reported by: | saroyanm | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Sitescripts | Keywords: | cms |
Cc: | juliandoucette, kvas, jsonesen | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by jsonesen)
Background
Most of our products are using "master" branch as a "production branch", to be consistent with all other products, we need to also generate the website's content from "master" branch.
What to change
Add an option to generate websites content from provided revision on site repository. Add -r/--rev option (allows specifying revision hashes, branches, tags or bookmarks; see hg help revisions for more detail) to python -m cms.bin.generate_static_pages
How to test
This will likely add a fair amount of test code to ensure stability but the process should be somewhat straight forward. Add bookmarks to the test site repository and diff the two files which contain changes across generation.
Attachments (0)
Change History (11)
comment:1 Changed on 03/15/2017 at 03:49:22 PM by kvas
- Cc jonsonesen added
- Description modified (diff)
comment:2 Changed on 03/28/2017 at 11:16:25 AM by jsonesen
- Cc jsonesen added; jonsonesen removed
comment:3 Changed on 03/28/2017 at 12:39:31 PM by kvas
I don't think we want to change the default behavior. The master bookmark is eyeo convention and I don't think we'd do ourself a service by hardcoding this rather specific thing into CMS which, I'd argue, should be as generic as possible.
Our current default is the same as Mercurial default (default branch) and that seems right. We could just provide -r/--rev option that does that same thing as Mercurial's -r/--rev option (allows specifying revision hashes, branches, tags or bookmarks; see hg help revisions for more detail). Seems like this would cover all current and foreseeable use cases and be pretty easy to implement.
comment:4 follow-up: ↓ 5 Changed on 03/29/2017 at 06:02:40 AM by jsonesen
Sure, -r/--rev is good for me.
Looks like the arg parsing is pretty rudimentary in generate_static_pages.py but should be super tough to add
comment:5 in reply to: ↑ 4 Changed on 03/29/2017 at 07:31:09 AM by kvas
Replying to jsonesen:
Looks like the arg parsing is pretty rudimentary in generate_static_pages.py but should be super tough to add
Maybe we add argparse-based proper argument parsing? Seems like that makes more sense going forward than growing our own stuff.
comment:6 Changed on 03/29/2017 at 07:37:35 AM by jsonesen
Maybe we add argparse-based proper argument parsing? Seems like that makes more sense going forward than growing our own stuff.
I agree :) Let's do that, it will be useful moving forward as well. Maybe we should still ask Sebastian?
comment:7 Changed on 03/29/2017 at 11:29:30 AM by jsonesen
- Description modified (diff)
- Summary changed from Generate website from the master branch [CMS] to Generate website from the master bookmark [CMS]
comment:9 Changed on 04/04/2017 at 08:50:22 AM by abpbot
A commit referencing this issue has landed:
Issue 4992 - Adds optional revision arg to generate_static_pages
comment:10 Changed on 04/04/2017 at 08:51:17 AM by jsonesen
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:11 Changed on 04/04/2017 at 08:51:25 AM by jsonesen
- Resolution set to fixed
- Status changed from reviewing to closed
Perhaps we could change the semantics here to utilize 'bookmark' rather than 'branch' since Mercurial is a dependency of the cms and, while they behave like git branches, Mercurial also has a feature called NamedBranches which do not have a git equivalent and are invoked using hg branch which can be confusing IMO...
Also, of we could start the discussion I think defaulting to master with optional changes to the default by passing -B <bookmark_name> or something.