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

Issue 6231 use more information from gitlab #6561

Merged
merged 5 commits into from
Feb 27, 2020
Merged

Issue 6231 use more information from gitlab #6561

merged 5 commits into from
Feb 27, 2020

Conversation

TomaszG
Copy link
Contributor

@TomaszG TomaszG commented Feb 26, 2020

User facing changelog

We're collecting more environment variables when running Cypress with GitLab CI.

Additional details

One of my projects required this to correctly create a commit URL. I'm not able to debug this on the Cypress Dashboard, however, I suspect that the commit link for GitLab may be incorrect.

PR Tasks

  • Have tests been added/updated?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 26, 2020

Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.

  • Please write [WIP] in the title of your Pull Request if your PR is not ready for review - someone will review your PR as soon as the [WIP] is removed.
  • Please familiarize yourself with the PR Review Checklist and feel free to make updates on your PR based on these guidelines.

PR Review Checklist

If any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'.

User Experience

  • The feature/bugfix is self-documenting from within the product.
  • The change provides the end user with a way to fix their problem (no dead ends).

Functionality

  • The code works and performs its intended function with the correct logic.
  • Performance has been factored in (for example, the code cleans up after itself to not cause memory leaks).
  • The code guards against edge cases and invalid input and has tests to cover it.

Maintainability

  • The code is readable (too many nested 'if's are a bad sign).
  • Names used for variables, methods, etc, clearly describe their function.
  • The code is easy to understood and there are relevant comments explaining.
  • New algorithms are documented in the code with link(s) to external docs (flowcharts, w3c, chrome, firefox).
  • There are comments containing link(s) to the addressed issue (in tests and code).

Quality

  • The change does not reimplement code.
  • There's not a module from the ecosystem that should be used instead.
  • There is no redundant or duplicate code.
  • There are no irrelevant comments left in the code.
  • Tests are testing the code’s intended functionality in the best way possible.

Internal

  • The original issue has been tagged with a release in ZenHub.

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One required change for code.

One of my projects required this to correctly create a commit URL.

Again, I'd like this more clearly defined because the information being collected through the Test Runner here is only used as meta information to be shown on the Dashboard.

The info shown in screenshot below (which is being collected correctly in our Gitlab run):

Screen Shot 2020-02-26 at 3 33 27 PM

What is it that you cannot do for your project or the information you cannot see on the Dashboard without this change? Can you paste a screenshot or explanation here or in the original issue as asked?

packages/server/lib/util/ci_provider.js Outdated Show resolved Hide resolved
@TomaszG
Copy link
Contributor Author

TomaszG commented Feb 26, 2020

@jennifer-shehane

So the thing is that I'm not using the Cypress Dashboard (mostly because even the highest plan wouldn't be sufficient), and instead of it I'm using a self-hosted alternative called sorry-cypress.

Due to the missing commit params which currently aren't sent for GitLab, some functions of it don't work properly so I tried to fix it at the source - Cypress CLI. Assuming that Cypress Dashboard correctly creates the commit link for GitLab provider it probably means that it doesn't use remoteOrigin commit param and instead of it, there's probably some condition implemented to use one of ciParams to create the link (instead of commitParams). I've looked at the runner code and I've seen ??? for those GitLab CI params so I decided to fix them as GitLab offers these in their CI pipelines.

So if only commit link on Cypress Dashboard works properly then there's no change from the user's perspective. It's only a cosmetical change to keep things in order and keep consistency.

@TomaszG TomaszG marked this pull request as ready for review February 26, 2020 15:57
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomaszG Yeah, I'm not sure how sorry-cypress works with this information, but in your CI provider, you need to ensure the git information is properly exposed as explained here: https://on.cypress.io/continuous-integration#Git-information

Either way, the code changes for this look fine.

@jennifer-shehane jennifer-shehane merged commit 9a78515 into cypress-io:develop Feb 27, 2020
@TomaszG TomaszG deleted the issue-6231-use-more-information-from-gitlab branch February 27, 2020 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing CI information from GitLab
2 participants