Coder Social home page Coder Social logo

percy-js's Introduction

percy-js's People

Contributors

auspicus avatar bstack-security-github avatar cadeparade avatar dependabot-preview[bot] avatar dependabot[bot] avatar djones avatar faun avatar fotinakis avatar itsjwala avatar joscha avatar kirkstrobeck avatar maprules1000 avatar robdel12 avatar snyk-bot avatar thomashuston avatar timhaines avatar wwilsman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

percy-js's Issues

Jssha dependency is deprecated

The jssha@v2 version that you're currently using is deprecated and prints a warning during installation:

➤ YN0061: │ jssha@npm:2.4.2 is deprecated: jsSHA versions < 3.0.0 will no longer receive feature updates

Consider upgrading to v3 and then updating the other Percy packages that depend on this percy-client package (namely @percy/agent):

   ├─ @percy/agent@npm:0.28.6 (via npm:^0.28.5)
   │  └─ percy-client@npm:3.8.0 (via npm:^3.2.0)
   │     └─ jssha@npm:2.4.2 (via npm:^2.1.0)

Fails to publish screenshots from bitbucket pull request pipeline

Getting error message

Uploading x snapshots to Percy.
Error:  { StatusCodeError: 400 - {"errors":[{"status":"bad_request"},{"source":{"pointer":"/data/attributes/sha"},"detail":"Sha must be 40 hexadecimal characters"}]}

In pull requests, but the same pipeline will run fine when triggered manually or by commit. My use case is that I would like to only run percy on the main branch and on PRs to that branch, not on individual feature branch commits or the like.

My pipeline uses the pull-requests build variant, like so:

image: circleci/node:10.22.1-browsers

pipelines:
  pull-requests:
    '**':
      - step:
          caches:
            - npm
          script:
            - npm ci
            - npm run-script build:storybook // build-storybook
            - npm run-script test:visual // percy-storybook --widths=320,1080
definitions:
  caches:
    npm: $HOME/.npm

I can work around the problem by using a configuration that always builds every commit:

image: circleci/node:10.22.1-browsers

pipelines:
  default:
    - step:
        caches:
          - npm
        script:
          - npm ci
          - npm run-script build:storybook // build-storybook
          - npm run-script test:visual // percy-storybook --widths=320,1080
definitions:
  caches:
    npm: $HOME/.npm

Git branch detection on Jenkins default is wrong (I think)

result = this._env.ghprbSourceBranch;

Looking at the line above, it seems that Percy is resorting to the PR builder plugin branch, however on master builds on Jenkins, the branch becomes HEAD.

I've found GIT_BRANCH to work better, however, that has an issue that it reports origin/master and Percy uses master for baseline snapshots. I couldn't find anywhere to change the baseline branch so I ended up writing this script:

#!/usr/bin/env node
const cli = require('@percy-io/percy-storybook/lib/cli');

process.env.PERCY_BRANCH = process.env.GIT_BRANCH === 'origin/master' ? 'master' : process.env.GIT_BRANCH;
process.env.PERCY_TOKEN = '***';
process.env.PERCY_PROJECT = '***';

cli.run([
  '--build_dir=storybook-content',
  '--widths = 320, 1280'
]).then(() => {
  process.on('exit', () => process.exit(0));
})
.catch(err => {
  console.log('Error: ', err); // eslint-disable-line no-console
  process.on('exit', () => process.exit(1));
});

which I now use to run from NPM. Works for now, but would be awesome if Percy did the smart work.

No documentation

We are using Percy on a project, and I am trying to explore using the percy-js module for some more custom functionality for the app. Unfortunately, there doesn't seem to be any documentation, despite the link to the percy.io site :(

Is there any plan to publish documentation for this module? Happy to help in any way I can :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.