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

[Env Package]: permalink structure update via wp cli #50538

Open
shashwatahalder01 opened this issue May 11, 2023 · 5 comments
Open

[Env Package]: permalink structure update via wp cli #50538

shashwatahalder01 opened this issue May 11, 2023 · 5 comments
Labels
Needs Testing Needs further testing to be confirmed. [Tool] Env /packages/env [Type] Bug An existing feature does not function as intended

Comments

@shashwatahalder01
Copy link

Description

Tried to update the permalink from plain to pretty using wp cli. Still getting errors on git action Linux environment.
CLI commands don't work on both env: development and test

The issue should be fixed by this PR. Is the issue still exist or I am doing something wrong?

Git Action:

name: End-to-End Tests

on:
  pull_request:
  push:
    branches:
      - e2e
concurrency:
  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
  cancel-in-progress: true

jobs:
  tests:
    name: e2e tests
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v3
        with:
         ref: "e2e"

      - name: Use desired version of NodeJS
        uses: actions/setup-node@v3
        with:
          node-version: '14'
          cache: "npm"
          
      - name: Install dependencies  & start wp env
        run: |
          cd tests/e2e 
          npm ci 
          npm run wp-env start       
  
      - name: Set Permalink structure
        run: |
          cd tests/e2e 
          npm run wp-env run cli 'wp rewrite structure /%postname%/'  --hard 
          curl http://localhost:8888/wp-json/wp/v2

.wp-env.json:

{
      "core": null,
      "phpVersion": "7.4",
      "plugins": [
        "https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip"
      ],
      "themes": [
        "https://downloads.wordpress.org/theme/storefront.latest-stable.zip"
      ]
}

Step-by-step reproduction instructions

  1. start wp-env on git action
  2. try to update permalink using cli

Screenshots, screen recording, code snippet

Screenshot at May 11 16-01-22

Environment info

"@wordpress/env": "^7.0.0"

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@mrfoxtalbot mrfoxtalbot added [Tool] Env /packages/env [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels May 22, 2023
@github-actions
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jun 22, 2023
@swissspidy
Copy link
Member

See #49962 (comment)

One needs to add a custom wp-cli.yml file telling WP-CLI that mod_rewrite is available. Then the .htaccess file seems to be created reliably, at least on my local computer.

Strangely, I didn't get those warnings on GitHub Actions myself.

Perhaps you could give it a try?

If it works, IMHO wp-env could potentially set up this file by default to make everyone's lives easier.

@github-actions github-actions bot removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jul 7, 2023
@github-actions
Copy link

github-actions bot commented Aug 7, 2023

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 7, 2023
@jordesign
Copy link
Contributor

Hi @shashwatahalder01 - were you able to try out the suggestion mentioned in the previous comment?

@jordesign jordesign removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Oct 26, 2023
@shashwatahalder01
Copy link
Author

@jordesign - I tried the suggested soln. and it worked just fine. However, for my project, I kept a .htacess file in my repo and mapped that file in the .wp-env file. I agree with @swissspidy that wp-env should set up this file by default to make everyone's lives easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Needs further testing to be confirmed. [Tool] Env /packages/env [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants