• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jreleaser / jreleaser / #477

04 Apr 2025 05:53PM UTC coverage: 35.124% (-5.1%) from 40.183%
#477

push

github

aalmiray
fix(deploy): Add missing Forgejo messages

Related to #1842

18210 of 51845 relevant lines covered (35.12%)

0.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

47.83
/core/jreleaser-model-impl/src/main/java/org/jreleaser/model/internal/catalog/GithubCataloger.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 *
4
 * Copyright 2020-2025 The JReleaser authors.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     https://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
package org.jreleaser.model.internal.catalog;
19

20
import com.fasterxml.jackson.annotation.JsonIgnore;
21
import org.jreleaser.model.Active;
22
import org.jreleaser.model.internal.JReleaserContext;
23
import org.jreleaser.mustache.TemplateContext;
24

25
import java.util.LinkedHashSet;
26
import java.util.Map;
27
import java.util.Set;
28

29
import static java.util.Collections.unmodifiableMap;
30
import static java.util.Collections.unmodifiableSet;
31
import static org.jreleaser.mustache.MustacheUtils.applyTemplates;
32
import static org.jreleaser.mustache.Templates.resolveTemplate;
33
import static org.jreleaser.util.StringUtils.isNotBlank;
34

35
/**
36
 * @author Andres Almiray
37
 * @since 1.13.0
38
 */
39
public final class GithubCataloger extends AbstractCataloger<GithubCataloger, org.jreleaser.model.api.catalog.GithubCataloger> {
40
    private static final long serialVersionUID = 7313775984136209203L;
41

42
    private final Set<String> includes = new LinkedHashSet<>();
1✔
43
    private final Set<String> excludes = new LinkedHashSet<>();
1✔
44

45
    private String attestationName;
46
    private Boolean artifacts;
47
    private Boolean files;
48
    private Boolean deployables;
49

50
    @JsonIgnore
1✔
51
    private final org.jreleaser.model.api.catalog.GithubCataloger immutable = new org.jreleaser.model.api.catalog.GithubCataloger() {
1✔
52
        private static final long serialVersionUID = -63084180410612042L;
53

54
        @Override
55
        public String getAttestationName() {
56
            return attestationName;
×
57
        }
58

59
        @Override
60
        public boolean isArtifacts() {
61
            return GithubCataloger.this.isArtifacts();
×
62
        }
63

64
        @Override
65
        public boolean isFiles() {
66
            return GithubCataloger.this.isFiles();
×
67
        }
68

69
        @Override
70
        public boolean isDeployables() {
71
            return GithubCataloger.this.isDeployables();
×
72
        }
73

74
        @Override
75
        public Set<String> getIncludes() {
76
            return unmodifiableSet(includes);
×
77
        }
78

79
        @Override
80
        public Set<String> getExcludes() {
81
            return unmodifiableSet(excludes);
×
82
        }
83

84
        @Override
85
        public String getGroup() {
86
            return GithubCataloger.this.getType();
×
87
        }
88

89
        @Override
90
        public String getType() {
91
            return GithubCataloger.this.getType();
×
92
        }
93

94
        @Override
95
        public Active getActive() {
96
            return GithubCataloger.this.getActive();
×
97
        }
98

99
        @Override
100
        public boolean isEnabled() {
101
            return GithubCataloger.this.isEnabled();
×
102
        }
103

104
        @Override
105
        public Map<String, Object> asMap(boolean full) {
106
            return GithubCataloger.this.asMap(full);
×
107
        }
108

109
        @Override
110
        public String getPrefix() {
111
            return GithubCataloger.this.prefix();
×
112
        }
113

114
        @Override
115
        public Map<String, Object> getExtraProperties() {
116
            return unmodifiableMap(GithubCataloger.this.getExtraProperties());
×
117
        }
118
    };
119

120
    public GithubCataloger() {
121
        super("github");
1✔
122
    }
1✔
123

124
    public org.jreleaser.model.api.catalog.GithubCataloger asImmutable() {
125
        return immutable;
×
126
    }
127

128
    @Override
129
    public void merge(GithubCataloger source) {
130
        super.merge(source);
1✔
131
        this.attestationName = merge(this.attestationName, source.attestationName);
1✔
132
        this.artifacts = merge(this.artifacts, source.artifacts);
1✔
133
        this.files = merge(this.files, source.files);
1✔
134
        this.deployables = merge(this.deployables, source.deployables);
1✔
135
        setIncludes(merge(this.includes, source.includes));
1✔
136
        setExcludes(merge(this.excludes, source.excludes));
1✔
137
    }
1✔
138

139
    @Override
140
    public boolean isSet() {
141
        return super.isSet() ||
×
142
            isNotBlank(attestationName) ||
×
143
            isArtifactsSet() ||
×
144
            isFilesSet() ||
×
145
            isDeployablesSet() ||
×
146
            !includes.isEmpty() ||
×
147
            !excludes.isEmpty();
×
148
    }
149

150
    public String getResolvedAttestationName(JReleaserContext context) {
151
        TemplateContext props = context.fullProps();
×
152
        context.getChangelog().apply(props);
×
153
        applyTemplates(props, resolvedExtraProperties());
×
154
        return resolveTemplate(attestationName, props);
×
155
    }
156

157
    public String getAttestationName() {
158
        return attestationName;
1✔
159
    }
160

161
    public void setAttestationName(String attestationName) {
162
        this.attestationName = attestationName;
1✔
163
    }
1✔
164

165
    public boolean isArtifactsSet() {
166
        return null != artifacts;
×
167
    }
168

169
    public boolean isArtifacts() {
170
        return null == artifacts || artifacts;
1✔
171
    }
172

173
    public void setArtifacts(Boolean artifacts) {
174
        this.artifacts = artifacts;
×
175
    }
×
176

177
    public boolean isFiles() {
178
        return null == files || files;
1✔
179
    }
180

181
    public void setFiles(Boolean files) {
182
        this.files = files;
×
183
    }
×
184

185
    public boolean isFilesSet() {
186
        return null != files;
×
187
    }
188

189
    public boolean isDeployablesSet() {
190
        return null != deployables;
×
191
    }
192

193
    public boolean isDeployables() {
194
        return null == deployables || deployables;
1✔
195
    }
196

197
    public void setDeployables(Boolean deployables) {
198
        this.deployables = deployables;
×
199
    }
×
200

201
    public Set<String> getIncludes() {
202
        return includes;
×
203
    }
204

205
    public void setIncludes(Set<String> includes) {
206
        this.includes.clear();
1✔
207
        this.includes.addAll(includes);
1✔
208
    }
1✔
209

210
    public Set<String> getExcludes() {
211
        return excludes;
×
212
    }
213

214
    public void setExcludes(Set<String> excludes) {
215
        this.excludes.clear();
1✔
216
        this.excludes.addAll(excludes);
1✔
217
    }
1✔
218

219
    @Override
220
    protected void asMap(boolean full, Map<String, Object> props) {
221
        props.put("attestationName", attestationName);
1✔
222
        props.put("artifacts", isArtifacts());
1✔
223
        props.put("files", isFiles());
1✔
224
        props.put("deployables", isDeployables());
1✔
225
        props.put("includes", includes);
1✔
226
        props.put("excludes", excludes);
1✔
227
    }
1✔
228
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc