Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to override default site path #745

Open
8 of 26 tasks
rmccue opened this issue Oct 16, 2024 · 5 comments
Open
8 of 26 tasks

Add option to override default site path #745

rmccue opened this issue Oct 16, 2024 · 5 comments
Labels
should have Should be done, medium priority for now
Milestone

Comments

@rmccue
Copy link
Member

rmccue commented Oct 16, 2024

For sites where the default site isn't the root of the local URL, it'd be useful to have a way to override the default that we provide to wp-cli. e.g. if your default site is at example.altis.dev/en/, you currently need to pass the URL every time.

I'd suggest we add a default_site_url option (e.g. "default_site_url": "https://example.altis.dev/en/"), or a default_site_path option (e.g. "default_site_path": "/en/") to override this.


Acceptance Criteria

  • When specifying a default site URL as "default_site_url": "example.altis.dev/en" in composer.json, composer server cli commands work without passing --url.
  • When not explicitly specifying a default site URL in composer.json, composer server cli commands use a default URL based on the domain setting
  • Given the above, CI builds also work
  • Passing a --url flag for a different sub site still works.
  • Tachyon URLs are still generated as example.altis.dev/tachyon and continue to function.
  • Perform manual testing on this with subsites at / and /en/ to check the default is working. (No automated testing required, as we don't have a framework in place.)
  • Record the process of testing into the ticket so that it can be replicated later.
  • Document in Local Server's docs about config options.

For Altis Team Use

Ready for Work Checklist

Is this ticket ready to be worked on? See
the Play Book Definition of Ready.

  • Is the title clear?
  • Is the description clear and detailed enough?
  • Are acceptance criteria listed?
  • Have any dependencies been identified? (Optional)
  • Have any documentation/playbook changes been identified? (Optional)
  • Is an estimate or time box assigned?
  • Is a priority label assigned?
  • Is this ticket added to a milestone?
  • Is this ticket added to an epic? (Optional)

Completion Checklist

Is this ticket done? See
the Play Book Definition of Done.

  • Has the acceptance criteria been met?
  • Is the documentation updated (including README)?
  • Do any code/documentation changes meet project standards?
  • Are automatic tests in place to verify the fix or new functionality?
    • Or are manual tests documented (at least on this ticket)?
  • Are any Playbook/Handbook pages updated?
  • Has a new module release (patch/minor) been created/scheduled?
  • Have the appropriate backport labels been added to the PR?
  • Is there a roll-out (and roll-back) plan if required?
@rmccue
Copy link
Member Author

rmccue commented Oct 16, 2024

This looks like the main place we generate the URL:

/**
* Get the name of the project for the local subdomain
*
* @return string
*/
protected function get_project_url() : string {
$config = $this->get_composer_config();
if ( $this->is_using_codespaces() ) {
return 'https://' . getenv( 'CODESPACE_NAME' ) . '-80.githubpreview.dev/';
}
$tld = $this->get_project_tld();
$site_url = sprintf( static::set_url_scheme( 'https://%s%s/' ),
$this->get_project_subdomain(),
$tld ? '.' . $tld : ''
);
return $site_url;
}

However, this is also used in the Docker compose generator for the Tachyon URL, so overriding this would break Tachyon URLs (e.g. would be https://example.altis.dev/en/tachyon/ which would break), so needs something slightly different. Possibly the Docker compose should be updated to use the hostname instead of the URL, but needs checking with the Codespaces support too.

@ferschubert-hm
Copy link
Contributor

Hey team! Please add your planning poker estimate with Zenhub @jerico @kovshenin @mikelittle @wisyhambolu

@ferschubert-hm ferschubert-hm added the to refine Issues needing refinement. label Oct 23, 2024
@ferschubert-hm
Copy link
Contributor

Please add your planning poker estimate with Zenhub @filter182

@jerico
Copy link
Contributor

jerico commented Dec 4, 2024

@ferschubert-hm @filter182 Please add you planning poker estimate

@jerico
Copy link
Contributor

jerico commented Dec 4, 2024

@mikelittle Please add the note how to set it up on Altis

@rmccue rmccue removed the to refine Issues needing refinement. label Dec 11, 2024
@mikelittle mikelittle added this to the Altis v22 milestone Dec 11, 2024
@rmccue rmccue added the should have Should be done, medium priority for now label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
should have Should be done, medium priority for now
Projects
None yet
Development

No branches or pull requests

4 participants