Skip to content

Commit

Permalink
Updates after organization rename
Browse files Browse the repository at this point in the history
  • Loading branch information
pkliczewski committed Dec 12, 2024
1 parent 4d9adbb commit 24c9269
Show file tree
Hide file tree
Showing 90 changed files with 2,065 additions and 656 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/m2k-func.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
env:
WORKDIR: workflows/move2kube/m2k-func
MVN_OPTS: ""
WF_CONFIG_REPO: parodos-dev/serverless-workflows-config
WF_CONFIG_REPO: rhdhorchestrator/serverless-workflows-config
REGISTRY_REPO: orchestrator
GH_TOKEN: ${{ secrets.HELM_REPO_TOKEN }}
GH_TOKEN: ${{ secrets.HELM_REPO_TOKEN }}

jobs:
build-and-push-m2k-func:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:

- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"

- uses: actions/github-script@v7
id: get_pr_data
with:
Expand All @@ -85,7 +85,7 @@ jobs:
- name: Send PRs to config repo
if: ${{ ! inputs.it_mode }}
env:
GH_TOKEN: ${{ secrets.HELM_REPO_TOKEN }}
GH_TOKEN: ${{ secrets.HELM_REPO_TOKEN }}
run: |
# determine pr or commit url
if [ ${{ fromJSON(steps.get_pr_data.outputs.result)}} != "" ]; then
Expand All @@ -99,7 +99,7 @@ jobs:
${PR_OR_COMMIT_URL} \
"yq --inplace '.kfunction.image=\"quay.io/orchestrator/serverless-workflow-m2k-kfunc:${GITHUB_SHA}\"' charts/move2kube/values.yaml" \
scripts/create_automated_m2k_kfunc_pr.sh \
${{ github.event.head_commit.author.email || 'parodos@redhat.com' }} \
${{ github.event.head_commit.author.email || 'rhdhorchestrator@redhat.com' }} \
${{ github.event.head_commit.author.name || github.triggering_actor }} \
${{ env.WORKDIR }} \
${{ env.GH_TOKEN }} \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ on:
default: false

env:
WF_CONFIG_REPO: parodos-dev/serverless-workflows-config
WF_CONFIG_REPO: rhdhorchestrator/serverless-workflows-config
REGISTRY_REPO: orchestrator
GH_TOKEN: ${{ secrets.HELM_REPO_TOKEN }}
GH_TOKEN: ${{ secrets.HELM_REPO_TOKEN }}

jobs:
build:
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
generate-manifests:
needs: build
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Generate Manifests
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
${PR_OR_COMMIT_URL} \
"" \
scripts/create_automated_pr.sh \
${{ github.event.head_commit.author.email || 'parodos@redhat.com' }} \
${{ github.event.head_commit.author.email || 'rhdhorchestrator@redhat.com' }} \
${{ github.event.head_commit.author.name || github.triggering_actor }} \
$WORKDIR \
${{ env.GH_TOKEN }} \
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/move2kube-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Move2kube Workflow end to end tests
name: Move2kube Workflow end to end tests

on:
workflow_dispatch:
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Deploy sonataflow-operator
run: |
helm repo add orchestrator https://parodos-dev.github.io/orchestrator-helm-chart
helm repo add orchestrator https://rhdhorchestrator.github.io/orchestrator-helm-chart
helm install orchestrator orchestrator/orchestrator-k8s --set platform.eventing.broker.name=""
kubectl get sfp -A
Expand All @@ -95,7 +95,7 @@ jobs:
-n knative-serving \
--type merge \
-p '{"data":{"kubernetes.podspec-init-containers": "enabled", "kubernetes.podspec-securitycontext": "enabled"}}'
yq --inplace '.spec.podTemplate.container |= ( . + {"env": [{"name": "K_SINK", "value": "http://broker-ingress.knative-eventing.svc.cluster.local/sonataflow-infra/default"}]} )' manifests/0?-sonataflow_m2k.yaml
# reuse orchestrator psql persistence for e2e tests
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
yq --inplace ".data.NOTIFICATIONS_BEARER_TOKEN=\"$BACKEND_SECRET\"" manifests/0?-secret_m2k.yaml # notsecret
cat manifests/0?-secret_m2k.yaml
# deploy the manifests created by the ${{ steps.build-image.outputs.image }}"
# deploy the manifests created by the ${{ steps.build-image.outputs.image }}"
kubectl apply -f manifests
sleep 5
kubectl get deployment m2k -o yaml
Expand All @@ -134,7 +134,7 @@ jobs:
sleep 15
kubectl get pods -o wide
kubectl wait --for=condition=Ready=true pods -l "app=m2k" --timeout=1m
kubectl patch configmap/m2k-props \
--type merge \
-p '{"data": {"application.properties" :"move2kube_url=http://move2kube-instance-svc.default.svc.cluster.local:8080\nquarkus.rest-client.move2kube_yaml.url=http://move2kube-instance-svc.default.svc.cluster.local:8080\nquarkus.rest-client.notifications.url=http://orchestrator-backstage.default.svc.cluster.local:7007/"}}'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/mta-v7.x-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MTA v7.x Workflow end to end tests
name: MTA v7.x Workflow end to end tests

on:
workflow_dispatch:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
run: |
kubectl apply -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/crds.yaml
# give the apiserver time
sleep 5s
sleep 5s
kubectl apply -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/olm.yaml
- name: Install Konveyor 0.3 (MTA upstream equivalent to 7.0)
Expand All @@ -44,8 +44,8 @@ jobs:
# give the apiserver time
echo "sleeping 300 seconds to give time for the operator to pull images and start"
sleep 300s
kubectl get csv -A
# TODO its a bit smelly that the csv name is coded here.
kubectl get csv -A
# TODO its a bit smelly that the csv name is coded here.
kubectl wait --for=jsonpath='{.status.phase}=Succeeded' -n my-konveyor-operator csv/konveyor-operator.v0.3.2
kubectl get pods -A
kubectl wait --for=condition=Ready=true pods -l "name=tackle-operator" -n my-konveyor-operator --timeout=240s
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Deploy sonataflow-operator
run: |
helm repo add orchestrator https://parodos-dev.github.io/orchestrator-helm-chart
helm repo add orchestrator https://rhdhorchestrator.github.io/orchestrator-helm-chart
helm install orchestrator orchestrator/orchestrator-k8s --set platform.eventing.broker.name=""
kubectl get sfp -A
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/workflow-executor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
default: true

env:
WF_CONFIG_REPO: parodos-dev/serverless-workflows-config
WF_CONFIG_REPO: rhdhorchestrator/serverless-workflows-config
REGISTRY_REPO: orchestrator
GH_TOKEN: ${{ secrets.HELM_REPO_TOKEN }}

Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
gen-manifests
# TODO Push manifests to repo
- name: Push manifests to CD repo
if: ${{ ! inputs.it_mode }}
run: |
Expand All @@ -90,7 +90,7 @@ jobs:
fi
WORKDIR=${{ runner.temp }}/serverless-workflows
make WORKFLOW_ID=${{ inputs.workflow_id }} \
WORKDIR=${WORKDIR} \
APPLICATION_ID=${{ inputs.application_id }} \
Expand Down
2 changes: 1 addition & 1 deletion .tekton/m2k-func-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://github.com/parodos-dev/serverless-workflows?rev={{revision}}
build.appstudio.openshift.io/repo: https://github.com/rhdhorchestrator/serverless-workflows?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
Expand Down
2 changes: 1 addition & 1 deletion .tekton/m2k-func-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://github.com/parodos-dev/serverless-workflows?rev={{revision}}
build.appstudio.openshift.io/repo: https://github.com/rhdhorchestrator/serverless-workflows?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
Expand Down
2 changes: 1 addition & 1 deletion .tekton/move2kube-serverless-workflow-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://github.com/parodos-dev/serverless-workflows?rev={{revision}}
build.appstudio.openshift.io/repo: https://github.com/rhdhorchestrator/serverless-workflows?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
Expand Down
2 changes: 1 addition & 1 deletion .tekton/move2kube-serverless-workflow-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://github.com/parodos-dev/serverless-workflows?rev={{revision}}
build.appstudio.openshift.io/repo: https://github.com/rhdhorchestrator/serverless-workflows?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
Expand Down
2 changes: 1 addition & 1 deletion .tekton/mta-serverless-workflow-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://github.com/parodos-dev/serverless-workflows?rev={{revision}}
build.appstudio.openshift.io/repo: https://github.com/rhdhorchestrator/serverless-workflows?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
Expand Down
2 changes: 1 addition & 1 deletion .tekton/mta-serverless-workflow-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
build.appstudio.openshift.io/repo: https://github.com/parodos-dev/serverless-workflows?rev={{revision}}
build.appstudio.openshift.io/repo: https://github.com/rhdhorchestrator/serverless-workflows?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Follow these steps to successfully add a new workflow:
6. Create a PR to [serverless-workflows-config repository][3] and make sure its merge.
7. Now the PR from 4 can be merged and an automatic PR will be created with the generated manifests. Review and merge.

See [Continuous Integration with make](https://github.com/parodos-dev/serverless-workflows/blob/main/make.md) for implementation details of the CI pipeline.
See [Continuous Integration with make](https://github.com/rhdhorchestrator/serverless-workflows/blob/main/make.md) for implementation details of the CI pipeline.

### Builder image

Expand All @@ -68,5 +68,5 @@ For every PR merged in the workflow directory, a GitHub Action runs an image bui

[1]: https://github.com/serverlessworkflow/specification/tree/main?tab=readme-ov-file#documentation
[2]: https://github.com/apache/incubator-kie-kogito-serverless-operator/
[3]: https://github.com/parodos-dev/serverless-workflows-config
[4]: https://github.com/parodos-dev/serverless-workflows/blob/main/best-practices.md
[3]: https://github.com/rhdhorchestrator/serverless-workflows-config
[4]: https://github.com/rhdhorchestrator/serverless-workflows/blob/main/best-practices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.rhdhorchestrator.jiralistener;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import io.cloudevents.CloudEvent;
import io.cloudevents.jackson.JsonFormat;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;

@Path("/")
@RegisterRestClient(configKey="ce-emitter")
public interface EventNotifier {

@POST
@Produces(JsonFormat.CONTENT_TYPE)
void emit(CloudEvent event);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package io.rhdhorchestrator.jiralistener;

import java.io.IOException;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.util.Map;

import com.fasterxml.jackson.databind.ObjectMapper;

import io.rhdhorchestrator.jiralistener.JiraListenerService.OnEventResponse;
import io.rhdhorchestrator.jiralistener.model.JiraIssue;
import io.rhdhorchestrator.jiralistener.model.WebhookEvent;
import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.Status;

@Path("/")
public class JiraListenerResource {
private Logger logger = System.getLogger(JiraListenerResource.class.getName());

@Inject
ObjectMapper mapper;

@Inject
JiraListenerService jiraListenerService;

// Test endpoint used in dev mode when not specifying a K_SINK variable
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/")
public void test(Object any) {
logger.log(Level.INFO, "RECEIVED " + any);
}

@POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/webhook/jira")
public Response onEvent(Map<String, Object> requestBody) {
logger.log(Level.INFO, "Received " + requestBody);

try {
WebhookEvent webhookEvent = mapper.readValue(mapper.writeValueAsBytes(requestBody), WebhookEvent.class);
logger.log(Level.INFO, "Received " + webhookEvent);
if (webhookEvent.getIssue() == null) {
logger.log(Level.WARNING, "Discarded because of missing field: issue");
return Response.noContent().build();
}
JiraIssue jiraIssue = webhookEvent.getIssue();

OnEventResponse response = jiraListenerService.onEvent(jiraIssue);
if (response.eventAccepted) {
return Response.ok(response.jiraTicketEventData).build();
}
return Response.noContent().build();
} catch (IOException e) {
return Response
.status(Status.BAD_REQUEST.getStatusCode(),
"Not a valid webhook event for a Jira issue: " + e.getMessage())
.build();
}
}
}
Loading

0 comments on commit 24c9269

Please sign in to comment.