Opened on 06/19/2017 at 04:12:29 PM

Closed on 01/09/2019 at 10:55:42 PM

Last modified on 10/08/2019 at 05:52:39 PM

#5333 closed change (fixed)

CMS does not support relative URLs

Reported by: juliandoucette Assignee: rhowell
Priority: P3 Milestone: Websites continuous integration
Module: Sitescripts Keywords:
Cc: wspee, kvas, jsonesen, ire, saroyanm Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29592634/
https://codereview.adblockplus.org/29933596/
https://codereview.adblockplus.org/29947567/

Description (last modified by wspee)

Background

When using GitLab CI for generating websites, absolute links generated by CMS become broken because all paths of the website are prefixed with an additional path component. There's no way to configure the CMS to generate relative links which would not break in such set up.

References:

What to do

To enable such deployments it should be possible to make the CMS generate relative URLs using a command line option to the generate_static_pages.py script named --relative.

Attachments (0)

Change History (26)

comment:1 Changed on 06/21/2017 at 10:47:08 AM by kvas

Just like with #5334 I don't think "defect" classification is correct here. Otherwise we could make this an option to generate_static_pages.py as well. Again, I think it should be off by default since I don't think that we always want this (or want to change how production works at the moment). Sounds good?

comment:2 Changed on 06/21/2017 at 11:13:19 AM by juliandoucette

  • Type changed from defect to change

Just like with #5334 I don't think "defect" classification is correct here.

Changed.

-- Again, I think the defect description is still effective.

Again, I think it should be off by default since I don't think that we always want this (or want to change how production works at the moment). Sounds good?

Yes.

comment:3 Changed on 07/07/2017 at 07:41:56 PM by kvas

  • Description modified (diff)
  • Priority changed from Unknown to P3
  • Ready set
  • Summary changed from CMS does not support relative hosts to CMS does not support relative URLs

comment:4 Changed on 07/09/2017 at 05:18:23 PM by juliandoucette

I'm not sure about the "What to do" here.

I'd like a solution that provides a better way to do this that also considers this.

comment:5 Changed on 07/13/2017 at 08:32:38 AM by ire

  • Cc ire added; iaderinokun removed

comment:6 Changed on 07/18/2017 at 01:39:30 PM by juliandoucette

I'd like a solution that provides a better way to do ​this that also considers this.

I think I was confusing this issue for #5343 (Create global get_page_url function in CMS) when I wrote this.

comment:7 Changed on 08/24/2017 at 11:36:14 PM by rhowell

  • Owner set to rhowell

comment:8 Changed on 09/05/2017 at 12:16:11 PM by juliandoucette

  • Milestone set to Websites continuous integration

comment:9 Changed on 10/17/2017 at 07:27:49 PM by rhowell

  • Owner rhowell deleted

comment:10 Changed on 10/18/2017 at 03:05:07 PM by wspee

  • Owner set to wspee

comment:11 Changed on 10/26/2017 at 08:51:18 AM by wspee

@juliandoucette

The URL mode would be controlled by a settings.ini option url-mode, which can be set to full-path (default) or relative-path (we might consider adding absolute value later to generate full absolute urls).

Do you feel strongly about this? I don't think it's necessary/useful to be able to control this via settings.ini because you'll probably never call it from command line but instead always from build automation (gulp). So unless I'm missing something here I would like to ommit this part.

comment:12 follow-up: Changed on 10/26/2017 at 08:59:54 AM by juliandoucette

Do you feel strongly about this?

First priority is "whatever we have to do to make CI work". Second priority is "whatever we can do to make usage less annoying". I prefer a command line argument - that way I can use different build processes in different environments without changing the website source code.

comment:13 in reply to: ↑ 12 Changed on 10/26/2017 at 09:01:49 AM by kvas

Replying to juliandoucette:

Do you feel strongly about this?

I prefer a command line argument - that way I can use different build processes in different environments without changing the website source code.

Yes, I've been also thinking that this is the best approach. I guess we can remove the part about settings.ini then.

comment:14 Changed on 10/30/2017 at 01:32:17 PM by wspee

  • Description modified (diff)

Ok, changed the description accordingly. I'm not attached to the name --relative it's just what I have been using, feel free to update the description if you feel otherwise.

comment:15 Changed on 05/02/2018 at 07:29:09 AM by wspee

  • Owner wspee deleted
  • Review URL(s) modified (diff)

comment:16 Changed on 05/14/2018 at 11:02:04 AM by rhowell

  • Owner set to rhowell

comment:17 Changed on 06/22/2018 at 03:44:28 PM by kvas

Hi Rosie,

I have looked at the changes in the reivew again as well as at the other places in the code that could be the points of intervention for implementing this ticket.

My impression is that the best and the cleanest approach would be to make the changes in converters.py around the points where resolve_link() is called: process_links() and linkify() (it seems that get_canonical_url() should return the absolute link regardless of relative/absolute URL mode).

You can start by building the tests that would fix the behavior that we want to achieve (I'm happy to advise on this, and we can also check with Julian when in doubt). After the tests are in place, we can see if there's a nice small adjustment to the link generation code that would make the tests pass. If everything fails along this path, we can think about some kind of post-processing solution along the lines of what Winsley implemented.

Cheers,
Vasily

comment:18 Changed on 11/07/2018 at 04:57:10 PM by rhowell

  • Status changed from new to reviewing

comment:19 Changed on 11/14/2018 at 11:41:00 PM by abpbot

A commit referencing this issue has landed:
Issue 5333 - Allow cms to generate relative pages

comment:20 Changed on 11/14/2018 at 11:46:41 PM by rhowell

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:21 Changed on 11/14/2018 at 11:48:29 PM by rhowell

  • Review URL(s) modified (diff)

comment:22 Changed on 11/20/2018 at 02:04:57 AM by rhowell

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:23 Changed on 12/19/2018 at 01:41:10 AM by rhowell

  • Review URL(s) modified (diff)
  • Status changed from reopened to reviewing

comment:24 Changed on 01/09/2019 at 10:53:59 PM by abpbot

comment:25 Changed on 01/09/2019 at 10:55:42 PM by rhowell

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:26 Changed on 07/11/2019 at 04:44:57 AM by congtyproship

spam

Last edited on 10/08/2019 at 05:52:39 PM by kzar

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from rhowell.
 
Note: See TracTickets for help on using tickets.