Skip to content

Commit

Permalink
try adding an "extended explanation" to compat bounds (#566)
Browse files Browse the repository at this point in the history
* try adding an "extended explanation"

* mention `julia` compat

* comment out `...`

* Update Project.toml
  • Loading branch information
ericphanson authored Jun 25, 2024
1 parent acad532 commit ddce19a
Show file tree
Hide file tree
Showing 19 changed files with 408 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RegistryCI"
uuid = "0c95cc5f-2f7e-43fe-82dd-79dbcba86b32"
authors = ["Dilum Aluthge <[email protected]>", "Fredrik Ekre <[email protected]>", "contributors"]
version = "10.4.0"
version = "10.5.0"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
42 changes: 36 additions & 6 deletions src/AutoMerge/guidelines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,41 @@ const guideline_compat_for_all_deps = Guideline(;
check=data -> meets_compat_for_all_deps(data.registry_head, data.pkg, data.version),
)

function compat_violation_message(bad_dependencies)
return string(
"The following dependencies do not have a `[compat]` entry ",
"that is upper-bounded and only includes a finite number ",
"of breaking releases: ",
join(bad_dependencies, ", "),
# Note the indentation here is important for the proper formatting within a bulleted list later
"""
<details><summary>Extended explanation</summary>
Your package has a Project.toml file which might look something like the following:
```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"
[deps]
# Package dependencies
# ...
[compat]
# ...
```
Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.
</details>
"""
)

end

function meets_compat_for_all_deps(working_directory::AbstractString, pkg, version)
package_relpath = get_package_relpath_in_registry(;
package_name=pkg, registry_path=working_directory
Expand Down Expand Up @@ -155,12 +190,7 @@ function meets_compat_for_all_deps(working_directory::AbstractString, pkg, versi
end
end
sort!(bad_dependencies)
message = string(
"The following dependencies do not have a `[compat]` entry ",
"that is upper-bounded and only includes a finite number ",
"of breaking releases: ",
join(bad_dependencies, ", "),
)
message = compat_violation_message(bad_dependencies)
return false, message
end
end
Expand Down
4 changes: 3 additions & 1 deletion test/automerge-unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ function comment_reference_test()
name = string("comment", "_pass_", pass, "_type_", type_name,
"_suggest_onepointzero_", suggest_onepointzero,
"_version_", version, "_point_to_slack_", point_to_slack)
reasons = ["Example guideline failed. Please fix it."]
reasons = [
AutoMerge.compat_violation_message(["julia"]),
"Example guideline failed. Please fix it."]
fail_text = AutoMerge.comment_text_fail(type, reasons, suggest_onepointzero, version; point_to_slack=point_to_slack)

@test_reference "reference_comments/$name.md" fail_text by=strip_equal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ Please make sure that you have read the [package naming guidelines](https://juli

## 2. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 3. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ Please make sure that you have read the [package naming guidelines](https://juli

## 2. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 3. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ Please make sure that you have read the [package naming guidelines](https://juli

## 2. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 3. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ Please make sure that you have read the [package naming guidelines](https://juli

## 2. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 3. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ Please make sure that you have read the [package naming guidelines](https://juli

## 2. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 3. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ Please make sure that you have read the [package naming guidelines](https://juli

## 2. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 3. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ Please make sure that you have read the [package naming guidelines](https://juli

## 2. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 3. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ Please make sure that you have read the [package naming guidelines](https://juli

## 2. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 3. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@ Hello, I am an automated registration bot. I help manage the registration proces

## 1. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 2. *Needs action*: here's what to do next
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@ Hello, I am an automated registration bot. I help manage the registration proces

## 1. [AutoMerge Guidelines](https://juliaregistries.github.io/RegistryCI.jl/stable/guidelines/) which are not met ❌

- The following dependencies do not have a `[compat]` entry that is upper-bounded and only includes a finite number of breaking releases: julia
<details><summary>Extended explanation</summary>

Your package has a Project.toml file which might look something like the following:

```toml
name = "YourPackage"
uuid = "random id"
authors = ["Author Names"]
version = "major.minor"

[deps]
# Package dependencies
# ...

[compat]
# ...
```

Every package listed in `[deps]`, along with `julia` itself, must also be listed under `[compat]` (if you don't have a `[compat]` section, make one!). See the [Pkg docs](https://pkgdocs.julialang.org/v1/compatibility/) for the syntax for compatibility bounds.

</details>

- Example guideline failed. Please fix it.

## 2. *Needs action*: here's what to do next
Expand Down
Loading

0 comments on commit ddce19a

Please sign in to comment.