Skip to content

Commit

Permalink
initial commit for git operations addition in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
yzainee committed Nov 13, 2018
1 parent 9668bb0 commit 643d15b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
10 changes: 10 additions & 0 deletions f8a_worker/dispatcher/flows/gitOperationsFlow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# This flow is for the git operations to generate the manifest files for the stack analysis.
flow-definitions:
- name: 'gitOperationsFlow'
queue: '{DEPLOYMENT_PREFIX}_gitOperationsFlow_v0'
propagate_node_args: true
node_args_from_first: true
edges:
- from:
to: 'GitOperationTask'
6 changes: 6 additions & 0 deletions f8a_worker/dispatcher/nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@
import: 'f8a_worker.workers'
max_retry: 0
queue: '{DEPLOYMENT_PREFIX}_{WORKER_ADMINISTRATION_REGION}_BookkeeperTask_v0'
- name: 'GitOperationTask'
classname: 'GitOperationTask'
import: 'f8a_worker.workers'
max_retry: 0
queue: '{DEPLOYMENT_PREFIX}_{WORKER_ADMINISTRATION_REGION}_GitOperationTask_v0'
- name: 'package_keywords_tagging'
classname: 'PackageKeywordsTaggingTask'
storage_task_name: 'keywords_tagging'
Expand Down Expand Up @@ -246,6 +251,7 @@
- 'dependencyIngestFlow'
- 'victimsFlow'
- 'osioUserNotificationFlow'
- 'gitOperationsFlow'

storages:
- name: 'BayesianPostgres'
Expand Down
2 changes: 2 additions & 0 deletions f8a_worker/workers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from f8a_worker.workers.victims import VictimsCheck
from f8a_worker.workers.user_notifier import UserNotificationTask
from f8a_worker.workers.repo_dependency_finder import RepoDependencyFinderTask
from f8a_worker.workers.git_operations import GitOperationTask

# avoid Vulture and Pyflakes warnings
assert CVEcheckerTask is not None
Expand Down Expand Up @@ -56,3 +57,4 @@
assert VictimsCheck is not None
assert UserNotificationTask is not None
assert RepoDependencyFinderTask is not None
assert GitOperationTask is not None
18 changes: 18 additions & 0 deletions f8a_worker/workers/git_operations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Git Operations Task."""

import json
from selinon import StoragePool
from f8a_worker.base import BaseTask
import requests
from git import Repo
from werkzeug.datastructures import FileStorage
import os


class GitOperationTask(BaseTask):
"""Do the git operations to get manifest files."""

def execute(self, arguments):
"""Perform the git operations."""
self.log.error("YUSUF: Hello World")
self.log.error(arguments.get('git_url'))
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ boto==2.48.0
botocore==1.10.25 # via boto3, s3transfer
celery==4.1.1 # via selinon
certifi==2018.4.16 # via requests
chardet==3.0.4 # via requests
chardet==3.0.4 # via requestsF
click==6.7 # via selinon
codegen==1.0 # via selinon
colorama==0.3.9 # via radon, rainbow-logging-handler
Expand All @@ -24,6 +24,7 @@ docutils==0.14 # via botocore
flake8-polyfill==1.0.2 # via radon
flake8==3.5.0 # via flake8-polyfill
git2json==0.2.3
gitpython==2.1.11
graphviz==0.8.3 # via selinon
idna==2.6 # via requests
jmespath==0.9.3 # via boto3, botocore
Expand Down Expand Up @@ -59,4 +60,5 @@ unidiff==0.5.5
urllib3==1.22 # via requests
vine==1.1.4 # via amqp
watchdog==0.8.3
werkzeug==0.14.1 # via flask
xmltodict==0.11.0 # via anymarkup

0 comments on commit 643d15b

Please sign in to comment.