Skip to content

Commit 2b94ccf

Browse files
Add the Pre-Commit Ecosystem (#13977)
* pre-commit scaffold * removing bazel example * Update file_parser_spec to use PreCommit::FileParser * Pre commit file fetcher (#13982) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser (#13991) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser * Add PreCommit ecosystem support with package manager and requirement classes * Set typed: true for spec files to enable type checking * add pre-commit to docker-dev-shell * Change type annotation from strict to strong in multiple files * lint * Add pre commit fixtures to yaml linting ignore list * Fix newline at end of file in .yamllint.yaml for pre_commit_configs ignore rule * Refactor PackageManager and FileParser initialization for improved clarity * lint * Add pre commit update checker functionality (#14019) * add pre commit update checker functionality * fix lint errors * add more specs * fix lint errors and failing specs * add test for package details fetcher and latest version finder * fix lint errors * fix lint errors * Add pre commit file updater functionality (#14020) * add pre commit file updater * fix same version in different repo issue * fix lint errors * update specs * remove unecessary comments in code * Fix no files changed error (#14053) * fix no files changed error * add spec for no files changed error * pre-commit scaffold * removing bazel example * Update file_parser_spec to use PreCommit::FileParser * Pre commit file fetcher (#13982) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser (#13991) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser * Add PreCommit ecosystem support with package manager and requirement classes * Set typed: true for spec files to enable type checking * add pre-commit to docker-dev-shell * Change type annotation from strict to strong in multiple files * lint * Add pre commit fixtures to yaml linting ignore list * Fix newline at end of file in .yamllint.yaml for pre_commit_configs ignore rule * Refactor PackageManager and FileParser initialization for improved clarity * lint * Add pre commit update checker functionality (#14019) * add pre commit update checker functionality * fix lint errors * add more specs * fix lint errors and failing specs * add test for package details fetcher and latest version finder * fix lint errors * fix lint errors * Add pre commit file updater functionality (#14020) * add pre commit file updater * fix same version in different repo issue * fix lint errors * update specs * remove unecessary comments in code * Fix no files changed error (#14053) * fix no files changed error * add spec for no files changed error * Implement base architecture for additional dependencies support for ecosystems (#14115) * add additional deps architecture * add additional deps architecture * add additional deps architecture * Add additional dependencies support for python (#14117) * add additional deps architecture * add additional deps architecture * add additional deps architecture * add additional support for python * fix sorbet and lint erros * Refactor Ecosystem Parsing in Pre-Commit (#14123) * Removing additional depenency parsering, and using the python ecosystem's parsers * reverting gem * Refactor lower bound operator handling in version extraction * Fix edge case failures in pre-commit additional dependencies support (#14135) * pre-commit scaffold * removing bazel example * Update file_parser_spec to use PreCommit::FileParser * Pre commit file fetcher (#13982) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser (#13991) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser * Add PreCommit ecosystem support with package manager and requirement classes * Set typed: true for spec files to enable type checking * add pre-commit to docker-dev-shell * Change type annotation from strict to strong in multiple files * lint * Add pre commit fixtures to yaml linting ignore list * Fix newline at end of file in .yamllint.yaml for pre_commit_configs ignore rule * Refactor PackageManager and FileParser initialization for improved clarity * lint * Add pre commit update checker functionality (#14019) * add pre commit update checker functionality * fix lint errors * add more specs * fix lint errors and failing specs * add test for package details fetcher and latest version finder * fix lint errors * fix lint errors * Add pre commit file updater functionality (#14020) * add pre commit file updater * fix same version in different repo issue * fix lint errors * update specs * remove unecessary comments in code * Fix no files changed error (#14053) * fix no files changed error * add spec for no files changed error * add additional deps architecture * add additional deps architecture * add additional deps architecture * add additional support for python * Removing additional depenency parsering, and using the python ecosystem's parsers * Implement base architecture for additional dependencies support for ecosystems (#14115) * add additional deps architecture * add additional deps architecture * add additional deps architecture * Add additional dependencies support for python (#14117) * add additional deps architecture * add additional deps architecture * add additional deps architecture * add additional support for python * fix sorbet and lint erros * restore updater gemfile and lockfile * call python requirements updater for update process * call python requirements updater for update process * Update pre_commit/lib/dependabot/pre_commit/additional_dependency_checkers/python.rb Co-authored-by: Rob Aiken <6567647+robaiken@users.noreply.github.com> * fix merge conflicts --------- Co-authored-by: Rob Aiken <6567647+robaiken@users.noreply.github.com> * Add support for Node.js additional dependencies (#14138) * feat: add support for Node.js additional dependencies in pre-commit hooks - Implemented `parse_dep_string` method in `Dependabot::NpmAndYarn::Requirement` to parse package names and versions. - Created `Node` class in `Dependabot::PreCommit::AdditionalDependencyCheckers` to handle Node.js additional dependencies. - Updated `FileParser` to recognize Node.js additional dependencies and parse them correctly. - Added integration tests for Node.js additional dependencies in pre-commit hooks. - Updated Dockerfile and gemspec to include necessary dependencies for Node.js support. - Created fixtures for testing Node.js additional dependencies in pre-commit configurations. * replace StanderdError with specific errors * Add support for Rust additional dependencies (#14147) * Add Rust support for additional dependencies in pre-commit hooks * Add Rust support for additional dependencies in pre-commit hooks * adding back comments * Fixing specs * Add additional dependencies support for go modules (#14144) * pre-commit scaffold * removing bazel example * Update file_parser_spec to use PreCommit::FileParser * Pre commit file fetcher (#13982) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser (#13991) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser * Add PreCommit ecosystem support with package manager and requirement classes * Set typed: true for spec files to enable type checking * add pre-commit to docker-dev-shell * Change type annotation from strict to strong in multiple files * lint * Add pre commit fixtures to yaml linting ignore list * Fix newline at end of file in .yamllint.yaml for pre_commit_configs ignore rule * Refactor PackageManager and FileParser initialization for improved clarity * lint * Add pre commit update checker functionality (#14019) * add pre commit update checker functionality * fix lint errors * add more specs * fix lint errors and failing specs * add test for package details fetcher and latest version finder * fix lint errors * fix lint errors * Add pre commit file updater functionality (#14020) * add pre commit file updater * fix same version in different repo issue * fix lint errors * update specs * remove unecessary comments in code * Fix no files changed error (#14053) * fix no files changed error * add spec for no files changed error * add additional dependencies support for go modules * remove comments and fix lint erros * fix sorbet errors * remove comments * fix merge conflicts --------- Co-authored-by: Rob Aiken <6567647+robaiken@users.noreply.github.com> * Add additional dependencies support for Ruby (#14160) * pre-commit scaffold * removing bazel example * Update file_parser_spec to use PreCommit::FileParser * Pre commit file fetcher (#13982) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser (#13991) * Implement pre-commit file fetching * Add exclude path * Refactor file fetcher specs to use experiment registration for beta ecosystems and enhance file fetching tests for various pre-commit config formats * Implement PreCommit file parser * Add PreCommit ecosystem support with package manager and requirement classes * Set typed: true for spec files to enable type checking * add pre-commit to docker-dev-shell * Change type annotation from strict to strong in multiple files * lint * Add pre commit fixtures to yaml linting ignore list * Fix newline at end of file in .yamllint.yaml for pre_commit_configs ignore rule * Refactor PackageManager and FileParser initialization for improved clarity * lint * Add pre commit update checker functionality (#14019) * add pre commit update checker functionality * fix lint errors * add more specs * fix lint errors and failing specs * add test for package details fetcher and latest version finder * fix lint errors * fix lint errors * Add pre commit file updater functionality (#14020) * add pre commit file updater * fix same version in different repo issue * fix lint errors * update specs * remove unecessary comments in code * Fix no files changed error (#14053) * fix no files changed error * add spec for no files changed error * add additional deps support for ruby * fix merge conflicts * revert removed comment --------- Co-authored-by: Rob Aiken <6567647+robaiken@users.noreply.github.com> * Adding pre_commit gem in gem * Bump dependabot-pre_commit and related dependencies to version 0.361.1 * Add dependabot-pre_commit gem and update Gemfile.lock * Add pre_commit ecosystem to Dockerfile for source management * Add pre_commit volume mappings to devcontainer configuration * revert incorrect gem lock file changes * add dependabot-bundler in gemspec * add dependabot-bundler in gemspec * add comment in dockerfile updater core to invalidate cache from ghcr registry * fix lint error * add arg in dockerfile updater core to force cache invalidation * add pre_commit dependency to setup * fix order of COPY commands in Dockerfile for consistency * remove pre_commit volume mapping from dependabot script * revert updater gemfile and lockfile changes b1546fe * revert changes in updater setup file --------- Co-authored-by: Abhishek <abhishekbhaskar@github.com>
1 parent 47e7666 commit 2b94ccf

File tree

88 files changed

+7718
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+7718
-9
lines changed

.devcontainer/core-dev/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
"-v", "${localWorkspaceFolder}/nuget/dependabot-nuget.gemspec:/home/dependabot/dependabot-core/nuget/dependabot-nuget.gemspec",
6464
"-v", "${localWorkspaceFolder}/nuget/lib:/home/dependabot/dependabot-core/nuget/lib",
6565
"-v", "${localWorkspaceFolder}/nuget/spec:/home/dependabot/dependabot-core/nuget/spec",
66+
"-v", "${localWorkspaceFolder}/pre_commit/dependabot-pre_commit.gemspec:/home/dependabot/dependabot-core/pre_commit/dependabot-pre_commit.gemspec",
67+
"-v", "${localWorkspaceFolder}/pre_commit/lib:/home/dependabot/dependabot-core/pre_commit/lib",
68+
"-v", "${localWorkspaceFolder}/pre_commit/spec:/home/dependabot/dependabot-core/pre_commit/spec",
6669
"-v", "${localWorkspaceFolder}/pub/dependabot-pub.gemspec:/home/dependabot/dependabot-core/pub/dependabot-pub.gemspec",
6770
"-v", "${localWorkspaceFolder}/pub/lib:/home/dependabot/dependabot-core/pub/lib",
6871
"-v", "${localWorkspaceFolder}/pub/spec:/home/dependabot/dependabot-core/pub/spec",

.github/ci-filters.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ npm_and_yarn:
7777
nuget:
7878
- *shared
7979
- 'nuget/**'
80+
pre_commit:
81+
- *shared
82+
- 'pre_commit/**'
8083
pub:
8184
- *shared
8285
- 'pub/**'

.github/issue-labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@
8181

8282
"L: julia":
8383
- '(julia)'
84+
85+
"L: pre:commit":
86+
- '(pre_commit)'

.github/smoke-filters.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ npm_and_yarn:
5353
nuget:
5454
- *common
5555
- 'nuget/**'
56+
pre_commit:
57+
- *common
58+
- 'pre_commit/**'
5659
python:
5760
- *common
5861
- 'python/**'

.github/smoke-matrix.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@
9494
"test": "nuget-resolvability",
9595
"ecosystem": "nuget"
9696
},
97+
{
98+
"core": "opentofu",
99+
"test": "opentofu",
100+
"ecosystem": "opentofu"
101+
},
102+
{
103+
"core": "pre_commit",
104+
"test": "pre-commit",
105+
"ecosystem": "pre-commit"
106+
},
97107
{
98108
"core": "pub",
99109
"test": "pub",
@@ -119,11 +129,6 @@
119129
"test": "terraform",
120130
"ecosystem": "terraform"
121131
},
122-
{
123-
"core": "opentofu",
124-
"test": "opentofu",
125-
"ecosystem": "opentofu"
126-
},
127132
{
128133
"core": "vcpkg",
129134
"test": "vcpkg",

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- { path: maven, name: maven, ecosystem: maven }
3939
- { path: npm_and_yarn, name: npm_and_yarn, ecosystem: npm }
4040
- { path: nuget, name: nuget, ecosystem: nuget }
41+
- { path: pre_commit, name: pre_commit, ecosystem: pre-commit }
4142
- { path: pub, name: pub, ecosystem: pub }
4243
- { path: python, name: python_slow, ecosystem: pip }
4344
- { path: python, name: python, ecosystem: pip }

.github/workflows/images-branch.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
- { name: maven, ecosystem: maven }
8080
- { name: npm_and_yarn, ecosystem: npm }
8181
- { name: nuget, ecosystem: nuget }
82+
- { name: pre_commit, ecosystem: pre-commit }
8283
- { name: pub, ecosystem: pub }
8384
- { name: python, ecosystem: pip }
8485
- { name: rust_toolchain, ecosystem: rust-toolchain }

.github/workflows/images-latest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
- { name: maven, ecosystem: maven }
5757
- { name: npm_and_yarn, ecosystem: npm }
5858
- { name: nuget, ecosystem: nuget }
59+
- { name: pre_commit, ecosystem: pre-commit }
5960
- { name: pub, ecosystem: pub }
6061
- { name: python, ecosystem: pip }
6162
- { name: rust_toolchain, ecosystem: rust-toolchain }

.yamllint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ ignore:
2626
# TODO: VCR seems to be putting in bad indentation... need to track down why
2727
- "*/spec/fixtures/vcr_cassettes/*"
2828
- "helm/spec/fixtures/helm/*"
29+
- "pre_commit/spec/fixtures/pre_commit_configs/*"

Dockerfile.updater-core

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ COPY --chown=dependabot:dependabot updater/Gemfile updater/Gemfile.lock dependab
161161

162162
COPY --chown=dependabot:dependabot --parents */.bundle */*.gemspec common/lib/dependabot.rb LICENSE omnibus $DEPENDABOT_HOME
163163

164+
# This ARG must be updated when adding/removing ecosystems - it invalidates Docker layer cache
165+
ARG ECOSYSTEM_LIST="bazel bun bundler cargo composer conda devcontainers docker docker_compose dotnet_sdk elm git_submodules github_actions go_modules gradle helm hex julia maven npm_and_yarn nuget opentofu pre_commit pub python rust_toolchain silent swift terraform uv vcpkg"
164166
# prevent having all the source in every ecosystem image
165-
RUN for ecosystem in git_submodules terraform github_actions hex elm docker docker_compose nuget maven gradle cargo composer go_modules python pub npm_and_yarn bundler silent swift devcontainers dotnet_sdk bun uv helm julia vcpkg rust_toolchain conda bazel opentofu; do \
167+
RUN for ecosystem in $ECOSYSTEM_LIST; do \
166168
mkdir -p $ecosystem/lib/dependabot; \
167169
touch $ecosystem/lib/dependabot/$ecosystem.rb; \
168170
done

0 commit comments

Comments
 (0)