Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ci(github): add dependency version consistency custom-check #3612

Open
petermetz opened this issue Nov 1, 2024 · 2 comments · May be fixed by #3699
Open

ci(github): add dependency version consistency custom-check #3612

petermetz opened this issue Nov 1, 2024 · 2 comments · May be fixed by #3699
Assignees
Labels
Developer_Experience github_actions Pull requests that update GitHub Actions code P3 Priority 3: Medium Tests Anything related to tests be that automatic or manual, integration or unit, etc.
Milestone

Comments

@petermetz
Copy link
Contributor

Problem Statement

In our monorepository code reviewers have to manually keep track of contributors
using the correct version string for packages and their dependencies.

Types of issues that arise (not a complete list)

  1. We are on 2.0.0 and people send in a PR with a package with version 0.0.1 or 2.0.0-rc.1 or something else that's outdated.
  2. We are on 2.0.0 and people send in a PR where some of their local package dependencies use outdated versions of other packages. For example the core package declares that it depends on the common@1.0.0 package or for another exmaple, the core-api package declares that it depends on the common@2.0.0-rc.1 package. Both of these cases are wrong becaus they should only be using the current latest relesae version which in this case is 2.0.0
  3. Third party dependencies are being inconsistently dependend on. For examples 5 different packages end up using 5 different versions of express or @grpc-js/grpc which causes compilation issues across the board.
  4. Sometimes people make the effort to be consistent but then versions change on main and they don't realize that their pull request now needs updating just because of this. The issue is that git won't mark this as a merge conflict if it can auto-resolve the merge by using the wrong version so we need tooling to makes this type of mistake impossible to help both code reviewers and contributors alike (less manual effort for everyone)

Acceptance Criteria

  1. Use the software provided at
    https://github.com/bmish/check-dependency-version-consistency
  2. Ensure that there is a custom-check step implemented which uses that package.
  3. If you run yarn custom-check and any of the problems are present from the Types of issues that arise (not a complete list) section then it needs to fail.
  4. It needs to report failures using the existing conventions for all the other custom-checks we have in place.
  5. There has to be a separate npm script in the root package.json which allows contributors to run just this one check by itself as well. Call it tools:check-dependency-version-consistency
@petermetz petermetz added Developer_Experience github_actions Pull requests that update GitHub Actions code P3 Priority 3: Medium Tests Anything related to tests be that automatic or manual, integration or unit, etc. labels Nov 1, 2024
@petermetz petermetz added this to the v2.1.0 milestone Nov 1, 2024
@petermetz petermetz assigned petermetz and unassigned petermetz Nov 1, 2024
@jagpreetsinghsasan jagpreetsinghsasan self-assigned this Nov 7, 2024
jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Nov 19, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Nov 20, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Nov 21, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Nov 25, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Nov 25, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
@petermetz petermetz modified the milestones: v2.1.0, v2.2.0 Dec 2, 2024
jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Dec 10, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
@jagpreetsinghsasan
Copy link
Contributor

To incorporate fixes for this task (after the script is pushed to the code), I am creating tasks to approach this in a phased approach. Each of the phases will include a maximum of 5 packages (with the tougher ones in my opinion having less packages)

jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Dec 11, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
@jagpreetsinghsasan jagpreetsinghsasan linked a pull request Dec 11, 2024 that will close this issue
5 tasks
jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Dec 11, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
@petermetz
Copy link
Contributor Author

To incorporate fixes for this task (after the script is pushed to the code), I am creating tasks to approach this in a phased approach. Each of the phases will include a maximum of 5 packages (with the tougher ones in my opinion having less packages)

@jagpreetsinghsasan Nice! Thank you very much!

jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Dec 17, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
jagpreetsinghsasan pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Dec 17, 2024
    Primary Changes
    ---------------
    1. Added a new custom check which checks if there
       are any inconsistency with the dependency version,
       which is already being used with an exsisting package.

    Changes needed to incorporate 1)
    -------------------------------
    2. Added a new dependency in the root package.json
    3. Added a new npm script in the root package.json
    4. Updated the lock file for the dependency inclusion

Fixes hyperledger-cacti#3612

Signed-off-by: jagpreetsinghsasan <jagpreetsinghsasan@accenture.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Developer_Experience github_actions Pull requests that update GitHub Actions code P3 Priority 3: Medium Tests Anything related to tests be that automatic or manual, integration or unit, etc.
Projects
None yet
2 participants