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

feat: azure devops support for labels #3396

Merged
merged 4 commits into from
Mar 28, 2019
Merged

feat: azure devops support for labels #3396

merged 4 commits into from
Mar 28, 2019

Conversation

JamieMagee
Copy link
Contributor

Still need to write tests, but I've tested it and the functionality works.

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

Don't forget to add a labels field to the getPr() result too

lib/platform/azure/index.js Show resolved Hide resolved
@JamieMagee
Copy link
Contributor Author

I'm having a lot of difficulty running tests locally. I get a lot of different snapshots. Have you seen anything like this before?

Snapshot Summary
 › 79 snapshots failed from 4 test suites. Inspect your code changes or run `yarn run jest -u` to update them.

Test Suites: 6 failed, 178 passed, 184 total
Tests:       99 failed, 1748 passed, 1847 total
Snapshots:   79 failed, 637 passed, 716 total
Time:        28.949s
Ran all test suites.

@rarkins
Copy link
Collaborator

rarkins commented Mar 19, 2019

@JamieMagee I've only seen before a small number of test failures, e.g. if someone doesn't have Python installed then there's at least one test that fails.

What do the failures say, and what's your platform/setup?

@JamieMagee
Copy link
Contributor Author

Here's my environment

$ uname -a
Linux jamagee-laptop 5.0.2-arch1-1-ARCH #1 SMP PREEMPT Thu Mar 14 18:47:49 UTC 2019 x86_64 GNU/Linux
$ node --version
v11.12.0

And here's an example of the failures I'm getting

 FAIL  test/config/validation.spec.js
  ● config/validation › validateConfig(config) › returns nested errors

    expect(value).toMatchSnapshot()

    Received value does not match stored snapshot "config/validation validateConfig(config) returns nested errors 1".

    - Snapshot
    + Received

    @@ -3,12 +3,12 @@
          "depName": "Configuration Error",
          "message": "Invalid configuration option: foo",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Invalid configuration option: lockFileMaintenance.bar",
    +     "message": "Unsafe regExp for packageRules[0].excludePackagePatterns: `(x+x+)+y`",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Unsafe regExp for packageRules[0].excludePackagePatterns: `(x+x+)+y`",
    +     "message": "Invalid configuration option: lockFileMaintenance.bar",
        },
      ]

      31 |       expect(warnings).toHaveLength(0);
      32 |       expect(errors).toHaveLength(3);
    > 33 |       expect(errors).toMatchSnapshot();
         |                      ^
      34 |     });
      35 |     it('included unsupported manager', async () => {
      36 |       const config = {

      at Object.toMatchSnapshot (test/config/validation.spec.js:33:22)

  ● config/validation › validateConfig(config) › errors for all types

    expect(value).toMatchSnapshot()

    Received value does not match stored snapshot "config/validation validateConfig(config) errors for all types 1".

    - Snapshot
    + Received

      Array [
        Object {
          "depName": "Configuration Error",
    -     "message": "extends: Invalid timezone: Europe/Brussel",
    +     "message": "Configuration option `enabled` should be boolean. Found: 1 (number)",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Configuration option `enabled` should be boolean. Found: 1 (number)",
    +     "message": "Invalid schedule: `Schedule "every 15 mins every weekday" should not specify minutes`",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Configuration option `labels` should be a list (Array)",
    +     "message": "timezone: Invalid timezone: Asia",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Configuration option `lockFileMaintenance` should be a json object",
    +     "message": "Configuration option `labels` should be a list (Array)",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Configuration option `packageRules[3].packagePatterns` should be a list (Array)",
    +     "message": "Configuration option `semanticCommitType` should be a string",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Configuration option `semanticCommitType` should be a string",
    +     "message": "Configuration option `lockFileMaintenance` should be a json object",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Invalid configuration option: packageRules[1].foo",
    +     "message": "extends: Invalid timezone: Europe/Brussel",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Invalid regExp for packageRules[3].excludePackagePatterns: `abc ([a-z]+) ([a-z]+))`",
    +     "message": "Invalid configuration option: packageRules[1].foo",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "Invalid schedule: `Schedule "every 15 mins every weekday" should not specify minutes`",
    +     "message": "Configuration option `packageRules[3].packagePatterns` should be a list (Array)",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "packageRules must contain JSON objects",
    +     "message": "Invalid regExp for packageRules[3].excludePackagePatterns: `abc ([a-z]+) ([a-z]+))`",
        },
        Object {
          "depName": "Configuration Error",
          "message": "packageRules: Each packageRule must contain at least one selector (paths, languages, baseBranchList, managers, datasources, depTypeList, packageNames, packagePatterns, excludePackageNames, excludePackagePatterns, sourceUrlPrefixes, updateTypes). If you wish for configuration to apply to all packages, it is not necessary to place it inside a packageRule at all.",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "timezone: Invalid timezone: Asia",
    +     "message": "packageRules must contain JSON objects",
        },
      ]

      93 |       );
      94 |       expect(warnings).toHaveLength(0);
    > 95 |       expect(errors).toMatchSnapshot();
         |                      ^
      96 |       expect(errors).toHaveLength(12);
      97 |     });
      98 |     it('selectors outside packageRules array trigger errors', async () => {

      at Object.toMatchSnapshot (test/config/validation.spec.js:95:22)

  ● config/validation › validateConfig(config) › selectors outside packageRules array trigger errors

    expect(value).toMatchSnapshot()

    Received value does not match stored snapshot "config/validation validateConfig(config) selectors outside packageRules array trigger errors 1".

    - Snapshot
    + Received

      Array [
        Object {
          "depName": "Configuration Error",
    -     "message": "docker.minor.packageNames: packageNames should be inside a `packageRule` only",
    +     "message": "packageNames: packageNames should be inside a `packageRule` only",
        },
        Object {
          "depName": "Configuration Error",
    -     "message": "packageNames: packageNames should be inside a `packageRule` only",
    +     "message": "docker.minor.packageNames: packageNames should be inside a `packageRule` only",
        },
      ]

      116 |       );
      117 |       expect(warnings).toHaveLength(0);
    > 118 |       expect(errors).toMatchSnapshot();
          |                      ^
      119 |       expect(errors).toHaveLength(2);
      120 |     });
      121 |     it('ignore packageRule nesting validation for presets', async () => {

      at Object.toMatchSnapshot (test/config/validation.spec.js:118:22)

@rarkins
Copy link
Collaborator

rarkins commented Mar 20, 2019

Try Node.js 10.x - I noticed problems with someone else's Node.js 11.x previously

@JamieMagee
Copy link
Contributor Author

Using Node.js 10.x seems to have worked. However, I noticed that all the errors with Node.js 11.x are due to the order of the objects being different. If you look at the error messages I posted above, all the error messages are still there but in the wrong order.

@JamieMagee JamieMagee changed the title feat: azure devops support for labels WIP feat: azure devops support for labels Mar 25, 2019
@rarkins rarkins mentioned this pull request Mar 26, 2019
@rarkins rarkins merged commit 80f8687 into renovatebot:master Mar 28, 2019
@renovate-bot
Copy link
Collaborator

🎉 This PR is included in version 14.58.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JamieMagee JamieMagee deleted the azure-labels branch September 25, 2019 20:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants