Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit d2a38d4

Browse files
pdxjohnnyjohn-s-andersen
authored and
john-s-andersen
committed
alice: shouldi: contribute: cicd: Boolean labels added via overlay
Install Alice: https://github.com/intel/dffml/tree/alice/entities/alice/ ```console $ python -m venv .venv $ . .venv/bin/activate $ python -m pip install -U pip setuptools wheel $ export ALICE_STATE_OF_ART=98335d941116e76bbf4e07422adc2b5061e47934 $ python -m pip install \ "https://github.com/intel/dffml/archive/${ALICE_STATE_OF_ART}.zip#egg=dffml" \ "https://github.com/intel/dffml/archive/${ALICE_STATE_OF_ART}.zip#egg=dffml-feature-git&subdirectory=feature/git" \ "https://github.com/intel/dffml/archive/${ALICE_STATE_OF_ART}.zip#egg=shouldi&subdirectory=examples/shouldi" \ "https://github.com/intel/dffml/archive/${ALICE_STATE_OF_ART}.zip#egg=dffml-config-yaml&subdirectory=configloader/yaml" \ "https://github.com/intel/dffml/archive/${ALICE_STATE_OF_ART}.zip#egg=dffml-operations-innersource&subdirectory=operations/innersource" \ "https://github.com/intel/dffml/archive/${ALICE_STATE_OF_ART}.zip#egg=alice&subdirectory=entities/alice" ``` Install this overlay (from this commit in this example): ```console $ python -m pip install --upgrade "git+https://github.com/intel/dffml@b5dd783580898f3cbf597cab925f006499cd6d2a#subdirectory=entities/alice" ``` Collect metrics on a repo using `alice shouldi contribute`: ```console $ alice -log debug shouldi contribute -keys https://github.com/pdxjohnny/httptest 2>&1 | tee .alice.shouldi.contribute.log.$(date "+%4Y-%m-%d-%H-%M").txt $ alice -log debug shouldi contribute -record-def GitHubRepoID -keys 149512216 2>&1 | tee .alice.shouldi.contribute.log.$(date "+%4Y-%m-%d-%H-%M").txt $ python -c 'import yaml, json, sys; print(yaml.dump(json.load(sys.stdin)))' < .tools/open-architecture/innersource/repos.json untagged: https://github.com/aliceoa/example-github-action: features: alice.shouldi.contribute.cicd:cicd_action_library: result: true group_by: ActionYAMLFileWorkflowUnixStylePath: - my_action_name/action.yml ``` Engineering Log: #1406 (reply in thread) Signed-off-by: John Andersen <[email protected]>
1 parent 17ccb5b commit d2a38d4

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from typing import NewType
2+
3+
import dffml
4+
import dffml_operations_innersource.operations
5+
6+
7+
IsCICDJenkinsLibrary = NewType("IsCICDJenkinsLibrary", bool)
8+
IsCICDGitHubActionsLibrary = NewType("IsCICDGitHubActionsLibrary", bool)
9+
CICDLibrary = NewType("CICDLibrary", dict)
10+
11+
12+
@dffml.op(
13+
stage=dffml.Stage.OUTPUT,
14+
)
15+
def cicd_library(
16+
self,
17+
cicd_jenkins_library: IsCICDJenkinsLibrary,
18+
cicd_action_library: IsCICDGitHubActionsLibrary,
19+
) -> CICDLibrary:
20+
return {
21+
"cicd-jenkins-library": cicd_jenkins_library,
22+
"cicd-action-library": cicd_action_library,
23+
}
24+
25+
26+
@dffml.op(
27+
stage=dffml.Stage.OUTPUT,
28+
)
29+
def cicd_jenkins_library(
30+
self,
31+
groovy_file_paths: dffml_operations_innersource.operations.GroovyFileWorkflowUnixStylePath,
32+
) -> IsCICDJenkinsLibrary:
33+
return bool(groovy_file_paths)
34+
35+
36+
@dffml.op(
37+
stage=dffml.Stage.OUTPUT,
38+
)
39+
def cicd_action_library(
40+
self,
41+
action_file_paths: dffml_operations_innersource.operations.ActionYAMLFileWorkflowUnixStylePath,
42+
) -> IsCICDGitHubActionsLibrary:
43+
return bool(action_file_paths)

entities/alice/entry_points.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ OverlayGitHub = alice.please.contribute.recomme
2323
[dffml.overlays.alice.please.contribute.recommended_community_standards.code_of_conduct]
2424
OverlayGit = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGit
2525
OverlayGitHub = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGitHub
26+
27+
[dffml.overlays.alice.shouldi.contribute]
28+
OverlayCICDLibrary = alice.shouldi.contribute.cicd

0 commit comments

Comments
 (0)