Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Foundation
IT
Websites
membership.eclipse.org
Commits
ed0cab4a
Unverified
Commit
ed0cab4a
authored
Aug 24, 2021
by
Martin Lowe
🇨🇦
Committed by
GitHub
Aug 24, 2021
Browse files
Add denylist for working groups to filter out certain wgs from the list (#266)
parent
cd404a4c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/eclipsefoundation/react/service/impl/DefaultWorkingGroupsService.java
View file @
ed0cab4a
...
...
@@ -13,12 +13,16 @@ package org.eclipsefoundation.react.service.impl;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
javax.annotation.PostConstruct
;
import
javax.enterprise.context.ApplicationScoped
;
import
javax.enterprise.inject.Instance
;
import
javax.inject.Inject
;
import
javax.json.bind.Jsonb
;
...
...
@@ -42,6 +46,8 @@ import io.quarkus.runtime.Startup;
public
class
DefaultWorkingGroupsService
implements
WorkingGroupsService
{
public
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
DefaultWorkingGroupsService
.
class
);
@ConfigProperty
(
name
=
"eclipse.working-groups.deny-list"
,
defaultValue
=
""
)
Instance
<
List
<
String
>>
denyList
;
@ConfigProperty
(
name
=
"eclipse.working-groups.filepath"
)
String
filepath
;
...
...
@@ -62,7 +68,10 @@ public class DefaultWorkingGroupsService implements WorkingGroupsService {
LOGGER
.
info
(
"Starting init of working group levels static members"
);
try
(
InputStream
is
=
Thread
.
currentThread
().
getContextClassLoader
().
getResourceAsStream
(
filepath
))
{
WorkingGroupMap
map
=
json
.
fromJson
(
is
,
WorkingGroupMap
.
class
);
this
.
wgs
=
map
.
getWorkingGroups
();
this
.
wgs
=
new
HashMap
<>();
// iterate over wg map entries and only retain entries not in denyList
map
.
getWorkingGroups
().
entrySet
().
stream
().
filter
(
entry
->
!
denyList
().
contains
(
entry
.
getKey
()))
.
forEach
(
e
->
wgs
.
put
(
e
.
getKey
(),
e
.
getValue
()));
LOGGER
.
info
(
"Initialized {} working group"
,
wgs
.
size
());
}
}
...
...
@@ -76,4 +85,8 @@ public class DefaultWorkingGroupsService implements WorkingGroupsService {
public
WorkingGroup
getByName
(
String
name
)
{
return
wgs
.
get
(
name
);
}
private
List
<
String
>
denyList
()
{
return
denyList
.
stream
().
flatMap
(
List:
:
stream
).
collect
(
Collectors
.
toList
());
}
}
src/main/resources/application.properties
View file @
ed0cab4a
...
...
@@ -12,6 +12,7 @@ fdn-api/mp-rest/scope=javax.inject.Singleton
## Required for wg interim solution, remove when moved to external API
quarkus.native.resources.includes
=
working_groups.json,templates/**
eclipse.working-groups.filepath
=
working_groups.json
eclipse.working-groups.deny-list
=
openhw-group,opengenesis
## MAILER SETTINGS
quarkus.mailer.auth-methods
=
DIGEST-MD5 CRAM-SHA256 CRAM-SHA1 CRAM-MD5 PLAIN LOGIN
...
...
src/test/resources/application.properties
View file @
ed0cab4a
...
...
@@ -5,6 +5,7 @@ fdn-api/mp-rest/scope=javax.inject.Singleton
## Required for wg interim solution, remove when moved to external API
quarkus.native.resources.includes
=
working_groups.json
eclipse.working-groups.filepath
=
working_groups.json
eclipse.working-groups.deny-list
=
openhw-group,opengenesis,gemoc
## DATASOURCE CONFIG
quarkus.datasource.db-kind
=
mariadb
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment