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

Docs for running with a specified node-version doesn't show how to change node version #468

Closed
laurie-wrisk opened this issue Jun 3, 2024 · 18 comments
Assignees

Comments

@laurie-wrisk
Copy link

laurie-wrisk commented Jun 3, 2024

The docs here: https://circleci.com/developer/orbs/orb/cypress-io/cypress#usage-node-version, says this is the way to change the node version for the orb:

version: '2.1'
orbs:
  cypress: cypress-io/cypress@3
workflows: null

But node version isn't specified anywhere here

@MikeMcC399
Copy link
Collaborator

@laurie-wrisk

The contents of https://circleci.com/developer/orbs/orb/cypress-io/cypress#usage-node-version (which you posted above) differ from https://github.com/cypress-io/circleci-orb/blob/master/src/examples/node-version.yml which contains:

description: >
  Run Cypress tests using the cypress/default executor with a specified node version.
usage:
  version: 2.1
  orbs:
    cypress: cypress-io/cypress@3
jobs:
  run-cypress-in-specified-node-version:
    executor:
      name: cypress/default
      node-version: "20.6"
    steps:
      - cypress/install:
          package-manager: "yarn"
      - cypress/run-tests:
          start-command: "npm run start:dev"
          cypress-command: "npx cypress run"
workflows:
  use-my-orb:
    jobs:
      - run-cypress-in-specified-node-version:
          name: Run Cypress in Node 20

I guess the two different text portions should be aligned.

It seems strange to define yarn as package-manager and then run a script with npm instead of yarn, but that doesn't hurt the node-version selection.

@jennifer-shehane
Copy link
Member

Yah I'm not sure what's happened with the generated docs on the orb website. There's some usages of node-version in the repo itself: https://github.com/search?q=repo%3Acypress-io%2Fcircleci-orb%20node-version&type=code

I have no idea why that node-version file has mixed package managers either. Probably just an oversight when we last rewrote the orb.

@MikeMcC399
Copy link
Collaborator

@jennifer-shehane

Are the docs supposed to be published automatically or is that a manual job to update them? The node-version search doesn't really bring any additional enlightenment on top of reading the full https://github.com/cypress-io/circleci-orb/blob/master/src/examples/node-version.yml.

command cypress/run-tests

To resolve this issue (#468), the example text from

dealing with how to set node-version together with the command cypress/run-tests needs to be corrected and then published to

job cypress/run

If there is an example for use together with the job cypress/run, then that should be added. If it is not possible to select a different Node.js version for use with the job cypress/run, then that should be explicitly stated in the documentation.

@jennifer-shehane
Copy link
Member

@MikeMcC399 I feel like the actual orb doc updates if you release a new version. I don't recall ever updating the docs independently so I'm not sure if that's possible. Seems like it should be possible though.

@MikeMcC399
Copy link
Collaborator

@jennifer-shehane

I feel like the actual orb doc updates if you release a new version. I don't recall ever updating the docs independently so I'm not sure if that's possible. Seems like it should be possible though.

I can't be of much assistance here as this part of interacting with CircleCI is only practical with Cypress.io access privileges. I have to leave it to your team to sort out. If things aren't working the way they should, then you may need to involve CircleCI support.

@MikeMcC399
Copy link
Collaborator

description: >
  Run Cypress tests using the cypress/default executor with a specified node version.
usage:
  version: 2.1
  orbs:
    cypress: cypress-io/cypress@3
jobs:
  run-cypress-in-specified-node-version:
    executor:
      name: cypress/default
      node-version: "20.6"
    steps:
      - cypress/install:
          package-manager: "npm"
      - cypress/run-tests:
          start-command: "npm run start:dev"
          cypress-command: "npx cypress run"
workflows:
  use-my-orb:
    jobs:
      - run-cypress-in-specified-node-version:
          name: Run Cypress in Node 20

@jennifer-shehane
Copy link
Member

Ah, pretty annoying. I feel like this might have happened before. 🤔

@MikeMcC399
Copy link
Collaborator

@jennifer-shehane

Ah, pretty annoying. I feel like this might have happened before. 🤔

Yes, it has happened before.

The publish log works silently giving no helpful details:

Preparing to publish your orb.
Production release detected!
Production version: 3.4.0

Once an orb is created it cannot be deleted. Orbs are semver compliant, and each published version is immutable. Publicly released orbs are potential dependencies for other projects.
Therefore, allowing orb deletion would make users susceptible to unexpected loss of functionality.
Orb `cypress-io/[email protected]` was published.
Please note that this is an open orb and is world-readable.



********************************************************************************
Your orb has been published to the CircleCI Orb Registry.
You can view your published orb on the CircleCI Orb Registry at the following link: 
https://circleci.com/developer/orbs/orb/cypress-io/cypress?version=3.4.0

@deiga
Copy link
Contributor

deiga commented Sep 25, 2024

I think it might be an indentation problem, drafting a PR

deiga added a commit to deiga/circleci-orb that referenced this issue Sep 25, 2024
@MikeMcC399
Copy link
Collaborator

@deiga

I think it might be an indentation problem, drafting a PR

@deiga
Copy link
Contributor

deiga commented Sep 26, 2024

@deiga

I think it might be an indentation problem, drafting a PR

@MikeMcC399
I'm not sure it's the same issue. Looking at it, it seems that the example is published correctly, but the published example is not a working one

@MikeMcC399
Copy link
Collaborator

@deiga

I'm not sure it's the same issue. Looking at it, it seems that the example is published correctly, but the published example is not a working one

jennifer-shehane pushed a commit that referenced this issue Sep 26, 2024
@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Oct 1, 2024

@jennifer-shehane

If you want to cut a new orb release the node documentation has a good chance of being correctly published now:

Preview on https://circleci.com/developer/orbs/orb/cypress-io/cypress?version=dev:b3455e432dad1a6db0f19889495ebcf62577fa3d#usage-node-version shows:

image

Current version cypress-io/[email protected] is unusable:

image

@jennifer-shehane
Copy link
Member

Tried to release this, but the job is failing: #492 (comment)

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Nov 7, 2024

@jennifer-shehane

Tried to release this, but the job is failing: #492 (comment)

@MikeMcC399
Copy link
Collaborator

@MikeMcC399
Copy link
Collaborator

CircleCI workflow log for failed v3.4.1 release https://app.circleci.com/pipelines/github/cypress-io/circleci-orb/1980 shows dev:alpha published on https://app.circleci.com/pipelines/github/cypress-io/circleci-orb/1980/workflows/8344eaa2-bceb-4654-b0b7-bd7e30a9a6df/jobs/7056

Your development orb has been published. It will expire in 30 days.
You can preview what this will look like on the CircleCI Orb Registry at the following link:
https://circleci.com/developer/orbs/orb/cypress-io/cypress?version=dev:98eca619c68c9db6fcff36aa1c92701265a5e76c

shows the node documentation correctly published https://circleci.com/developer/orbs/orb/cypress-io/cypress?version=dev:98eca619c68c9db6fcff36aa1c92701265a5e76c#usage-node-version . The blocker is the incorrect pnpm implementation.

version: '2.1'
orbs:
  cypress: cypress-io/cypress@3
jobs:
  run-cypress-in-specified-node-version:
    executor:
      name: cypress/default
      node-version: '20.6'
    steps:
      - cypress/install:
          package-manager: npm
      - cypress/run-tests:
          cypress-command: npx cypress run
          start-command: npm run start:dev
workflows:
  use-my-orb:
    jobs:
      - run-cypress-in-specified-node-version:
          name: Run Cypress in Node 20

@MikeMcC399
Copy link
Collaborator

https://circleci.com/developer/orbs/orb/cypress-io/cypress#usage-node-version now displays:

version: '2.1'
orbs:
  cypress: cypress-io/cypress@3
jobs:
  run-cypress-in-specified-node-version:
    executor:
      name: cypress/default
      node-version: '20.6'
    steps:
      - cypress/install:
          package-manager: npm
      - cypress/run-tests:
          cypress-command: npx cypress run
          start-command: npm run start:dev
workflows:
  use-my-orb:
    jobs:
      - run-cypress-in-specified-node-version:
          name: Run Cypress in Node 20

This issue is now resolved!

@MikeMcC399 MikeMcC399 self-assigned this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants