Skip to content

[6.0] Add Support for Github Codespaces #45719

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

Merged
merged 10 commits into from
Aug 20, 2025

Conversation

mahmoudmagdy1-1
Copy link

@mahmoudmagdy1-1 mahmoudmagdy1-1 commented Jul 13, 2025

Continuation of #45552

Summary of Changes

a fully Joomla stack : fresh joomla installation with phpmyadmin,xdebug,cypress
This PR adds the ability to test other PRs using GitHub Codespaces, or even use it as a full development environment.
you can access the database directly using phpmyadmin, and run tests using Cypress, you can find more details in the codespace-details.txt file after creating the codespace with this PR

Testing Instructions

  1. Create a new codespace from a branch that contains the .devcontainer files
  2. You can access and see the Joomla install / Cypress GUI in "ports" inside github.dev
  3. For credentials and more details you can see codespace-details.txt

Actual result BEFORE applying this Pull Request

N/A

Expected result AFTER applying this Pull Request

An easy way to test PRs on the cloud without setting everything up manually and on your local machine

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org: Add Docs for Github Codespaces Manual#496

  • No documentation changes for manual.joomla.org needed

@alikon alikon mentioned this pull request Jul 13, 2025
4 tasks
@brianteeman
Copy link
Contributor

Is it expected that at the end of the setup the terminal doesnt return to a prompt

image

@brianteeman
Copy link
Contributor

It is not possible to run the cypress tests as Joomla wont install in this configuration see screenshot

image

@mahmoudmagdy1-1
Copy link
Author

It is not possible to run the cypress tests as Joomla wont install in this configuration see screenshot

we don't need to run the installation script as Joomla is already installed automatically, you can access it when clicking on this after the github codespaces finishes building
image
other tests pass normally using this setup, for example:
image

@mahmoudmagdy1-1
Copy link
Author

mahmoudmagdy1-1 commented Jul 14, 2025

Is it expected that at the end of the setup the terminal doesnt return to a prompt

yes this is expected after building the container, but you can always start a new terminal

@brianteeman
Copy link
Contributor

Is it expected that at the end of the setup the terminal doesnt return to a prompt

yes this is expected after building the container, but you can always start a new terminal

thanks - was just checking

@brianteeman
Copy link
Contributor

It is not possible to run the cypress tests as Joomla wont install in this configuration see screenshot

we don't need to run the installation script as Joomla is already installed automatically, you can access it when clicking on this after the github codespaces finishes building

Then I suggest a change in the text is required because it currently says

    echo "  Run interactive tests: npx cypress open"
    echo "  Run headless tests:   npx cypress run"

and that fails because the first test is installation and that will fail for the reasons above

@mahmoudmagdy1-1
Copy link
Author

Then I suggest a change in the text is required because it currently says

    echo "  Run interactive tests: npx cypress open"
    echo "  Run headless tests:   npx cypress run"

and that fails because the first test is installation and that will fail for the reasons above

okay, what do you suggest i should change the text to? i want to also add that you can use npx cypress run --spec path/to/file.spec.js to run a specific spec and you don't have to run all specs at once
I think the current cypress tests are mainly focused on the ci pipeline (please correct me if i'm wrong), but at least with this setup if someone wants to test or add a spec they can

@mahmoudmagdy1-1
Copy link
Author

I just edited some of the joomla config names to match Cypress config' default values, and got Cypress to run and pass all tests, except 2 test files that had 2 errors each
image
those are the files with the errors
image
the error is the same for all 4 failing tests:
image

I would love to hear some feedback about the setup and if someone can direct me on how fix the last errors, this exact error was mentioned in #44434 but had no actual solution

@alikon
Copy link
Contributor

alikon commented Aug 4, 2025

even it is a temporay fix , as it is already done in other plcaes, you can do the same where tests are failing

// @TODO: The following line is just a temporary fix. Remove it and uncomment the 2 lines after it when done.
expect(response.status).to.eq(200);
// expect(response.status).to.eq(301);
// expect(response.redirectedToUrl).to.match(new RegExp(`${url}$`));

@laoneo
Copy link
Member

laoneo commented Aug 9, 2025

This is great work, thanks. But we need also proper documentation so it will get attention and can be used for testing pr's.

@mahmoudmagdy1-1
Copy link
Author

even it is a temporay fix , as it is already done in other plcaes, you can do the same where tests are failing

Okay sure

This is great work, thanks. But we need also proper documentation so it will get attention and can be used for testing pr's.

Thank you, Are we talking about documentation for the Joomla manual or where exactly? I'm willing to write a documentation for this feature

@softforge
Copy link
Contributor

Hi @mahmoudmagdy1-1 would really like to get this in 6.0 but you only have days before the beta, can you write the documentation and just check through the comments and @Bodge-IT and I will try and get some tests
Thank you.

@brianteeman
Copy link
Contributor

this pr doesnt include any production code so shouldnt be tied to the release of j6

@alikon
Copy link
Contributor

alikon commented Aug 12, 2025

imho should be backported to 5.3 / 5.4 as can help with the upcoming PBF

@alikon
Copy link
Contributor

alikon commented Aug 12, 2025

for 6.0 \define('JOOMLA_MINIMUM_PHP', '8.3.0');

update to php 8.3. for 6.0
@mahmoudmagdy1-1
Copy link
Author

mahmoudmagdy1-1 commented Aug 12, 2025

would really like to get this in 6.0 but you only have days before the beta

Hey @softforge, Like brian mentioned, it's not tied to the release of j6, it should work on all versions (5.3-dev, 5.4-dev) as well

can you write the documentation and just check through the comments and @Bodge-IT and I will try and get some tests Thank you.

Sure, I'm working on it right now, I think the best place for it, is : https://manual.joomla.org/docs/testing/manually

Thanks for the pr @alikon

@softforge
Copy link
Contributor

Hey @softforge, Like Brian mentioned, it's not tied to the release of j6, it should work on all versions (5.3-dev, 5.4-dev) as well

Thank you for your work to date. I had just posted it back into maintainers to ask for the process and open the discussion there. I'll let you know as soon as I have an answer.

@mahmoudmagdy1-1
Copy link
Author

Thank you for your work to date. I had just posted it back into maintainers to ask for the process and open the discussion there. I'll let you know as soon as I have an answer.

Thanks, I've also just added the documentation for this feature and put the link of the docs in the pr description

@alikon
Copy link
Contributor

alikon commented Aug 20, 2025

I have tested this item ✅ successfully on 371e787


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45719.

@alikon
Copy link
Contributor

alikon commented Aug 20, 2025

it would be good to have this pr merged for the upcoming PBF

@rdeutz
Copy link
Contributor

rdeutz commented Aug 20, 2025

I have tested this item ✅ successfully on 7753b0d

Looks ok so far, tested login into Joomla and phpmyadmin. Let run the system tests. Control window doesn't fit 100%.
Setup takes some time but compared to setting it up locally much faster. Execution of the system tests fast enough.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45719.

@laoneo laoneo merged commit 7d12a9f into joomla:6.0-dev Aug 20, 2025
30 of 31 checks passed
@laoneo
Copy link
Member

laoneo commented Aug 20, 2025

Thank you very much for all the work on this and the patience. Now it is time to spread the word.

@laoneo laoneo added this to the Joomla! 6.0.0 milestone Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants