You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce Shared YAML Dependency File To Manage Replace Directives (#4862)
* Introduce new dependency management tool
* Move syntax replace to top of go.mod to avoid confusion
* Apply replaces from tool
* Introduce PR workflow to check modules are synced
* Add E2E test
* Address some PR comments
Co-authored-by: Piotr <17101802+thampiotr@users.noreply.github.com>
* Refactor to use a centralised cobra CLI, called by generate.go
* Refactor to not generate .txt files and pass replace text in memory
* Refactor E2E tests to use explicit test data
* Update tools/generate-module-dependencies/replaces-mod.tpl
Co-authored-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
* Return errors in FileHelper instead of using Fatalf
* Address PR comments
* go mod/mod changes
* Reference actual calculated file to dependency yaml file in error logs
* Group the generate-module-dependencies and Check for go.mod changes properly in workflow
and use git diff instead so we can ignore whitespace changes
* nit: a few improvements for clarity
---------
Co-authored-by: Piotr <17101802+thampiotr@users.noreply.github.com>
Co-authored-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
# NOTE: replace directives below must always be *temporary*.
2
+
#
3
+
# Adding a replace directive to change a module to a fork of a module will
4
+
# only be accepted when a PR or an issue upstream has been opened to accept the new
5
+
# change.
6
+
#
7
+
# Contributors are expected to work with upstream to make their changes
8
+
# acceptable, and remove the `replace` directive as soon as possible.
9
+
#
10
+
# If upstream is unresponsive, you should consider making a hard fork
11
+
# (i.e., creating a new Go module with the same source) or picking a different
12
+
# dependency.
13
+
14
+
# Modules define the target files where replaces will be applied.
15
+
# Each module specifies:
16
+
# - name: the name of the module
17
+
# - path: the path to the module's go.mod file
18
+
# - file_type: enum of what sort of generation pipeline will be used, currently the only available value is "mod"
19
+
20
+
# Replace directives define the replacements that will be applied to the defined modules
21
+
# Each replace directive specifies:
22
+
# - comment: a brief explanation as to why the replace is necessary. This must contain a link to an upstream issue or a PR that is required to complete in order to remove the replace directive
23
+
# - dependency: the dependency to be replaced
24
+
# - replacement: the replacement for the dependency
25
+
26
+
modules:
27
+
- name: alloy
28
+
path: go.mod
29
+
file_type: mod
30
+
31
+
replaces:
32
+
- comment: >
33
+
TODO: remove this replace directive once the upstream issue is fixed:
0 commit comments