Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test 6 #6

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
de37e83
Test for display
rajuljha Jun 13, 2024
e85ae4c
Test custom keyword.conf
rajuljha Jun 16, 2024
e1ad14b
Correctworkflow by using custom image and try for new test cases
rajuljha Jun 16, 2024
a23abdd
Change version to v8
rajuljha Jun 16, 2024
1b54c47
Change version to v3
rajuljha Jun 16, 2024
2bbeaf8
Change workflow file
rajuljha Jun 20, 2024
2f99880
Change worflow file
rajuljha Jun 20, 2024
ea3255c
Merge branch 'main' into test_5
rajuljha Jun 20, 2024
5797cbb
Upload image as artifact GH action
rajuljha Jun 20, 2024
f323744
Save image as artifact
rajuljha Jun 20, 2024
80daad7
Test copyright
rajuljha Jun 20, 2024
0cd51fc
Correct workflow file
rajuljha Jun 20, 2024
56d6534
Change input type field
rajuljha Jun 20, 2024
f23fea5
Add file path as env var
rajuljha Jun 20, 2024
97062b8
On pull request add :nervous:
rajuljha Jun 20, 2024
101a859
try new syntax
rajuljha Jun 20, 2024
7e7c6cb
change to two different jobs
rajuljha Jun 20, 2024
6dfa81d
Check conditionally
rajuljha Jun 20, 2024
3d17480
Check conditionally
rajuljha Jun 20, 2024
7ef0714
Check conditionally
rajuljha Jun 20, 2024
f54a669
Check conditionally
rajuljha Jun 20, 2024
307f48c
Check conditionally
rajuljha Jun 20, 2024
98f5d22
Change branch to keyword_testing to be fetched
rajuljha Jun 20, 2024
9d69fa0
Print new vars for testig
rajuljha Jun 20, 2024
47d493d
Print new vars for testig
rajuljha Jun 20, 2024
a76093c
Print new vars for testig
rajuljha Jun 20, 2024
6fda6fa
Print new vars for testig
rajuljha Jun 20, 2024
db512f9
Print new vars for testig
rajuljha Jun 20, 2024
9bdd383
Test again :phew:
rajuljha Jun 20, 2024
8af007b
Test again :phew:
rajuljha Jun 20, 2024
3724b5d
Test again :phew:
rajuljha Jun 20, 2024
7ab038a
Test again :phew:
rajuljha Jun 20, 2024
15ad590
Test again :phew:
rajuljha Jun 20, 2024
2613cc4
Test again :add new workflow for sshing into runner
rajuljha Jun 20, 2024
57b1bdb
Add volume to given file inside container
rajuljha Jun 21, 2024
692cb30
Merge branch 'main' into test_5
rajuljha Jun 21, 2024
4c91c6d
Add volume to given file inside container : Correct syntac
rajuljha Jun 21, 2024
3d65d2b
Change file path in command
rajuljha Jun 21, 2024
eca82c9
Change test_keyword.conf file
rajuljha Jun 21, 2024
9c87b87
fix(actions) : Change branch of repo to be built to custom_keyword_co…
rajuljha Jun 21, 2024
1ec9db2
Change test_keyword.conf
rajuljha Jun 21, 2024
919c64e
Test qemu
rajuljha Jun 23, 2024
9c8569a
Test qemu
rajuljha Jun 23, 2024
e84fe85
Test qemu
rajuljha Jun 23, 2024
99ccd56
Test qemu
rajuljha Jun 23, 2024
aef89f4
Test qemu
rajuljha Jun 23, 2024
f23759e
Test qemu
rajuljha Jun 23, 2024
415ab15
Test qemu
rajuljha Jun 23, 2024
aa52861
Test qemu
rajuljha Jun 23, 2024
ae5fd5b
Test qemu
rajuljha Jun 23, 2024
9783f6d
Test qemu
rajuljha Jun 23, 2024
699240f
Test qemu
rajuljha Jun 23, 2024
c9aa2d0
Test qemu
rajuljha Jun 23, 2024
f141eef
Final Test qemu
rajuljha Jun 23, 2024
6f5853b
Add SIH
rajuljha Jun 29, 2024
2ad3a54
Add diff scans
rajuljha Jun 30, 2024
7abd439
Change docker image tag to diff for diff scans
rajuljha Jun 30, 2024
5af442b
Add new test action
rajuljha Jul 6, 2024
d41a4aa
Add new test action
rajuljha Jul 6, 2024
2d8d2ed
Test report formation
rajuljha Jul 6, 2024
f39a614
Test report formation
rajuljha Jul 6, 2024
c8abbe3
remove: images
rajuljha Jul 6, 2024
6101e3c
Use v4
rajuljha Jul 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions .github/workflows/foss-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check foss-action

on:
pull_request:

jobs:
compliance_check:
runs-on: ubuntu-latest
name: Perform Fossology Scan
steps:
- name: Checkout this repo
uses: actions/checkout@v2

- name: Run foss-action
uses: rajuljha/foss-action@v4
with:
scan_mode: "differential"
scanners: "nomos ojo copyright keyword"
from_tag: "v001"
to_tag: "v004"
report_format: "SPDX_JSON"
135 changes: 63 additions & 72 deletions .github/workflows/fossology-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,19 @@ name: Check diff for license with Fossology

on:
pull_request:
inputs:
file-path:
description: '/tmp.txt'
required: false

jobs:
build-docker-image:
name: Build Docker Image
runs-on: ubuntu-22.04
steps:
- name: Checkout this repository
uses: actions/checkout@v3

- name: Checkout specific branch of rajuljha/fossology repository
uses: actions/checkout@v3
with:
repository: rajuljha/fossology
ref: feat/automation/custom_keyword_conf_file
path: fossology-repo

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: |
docker buildx build --load -t rjknightmare/fo-ci-test:latest -f fossology-repo/utils/automation/Dockerfile.ci fossology-repo


check-license:
name: Check license
runs-on: ubuntu-22.04
needs: build-docker-image
steps:
- uses: actions/checkout@v3

- name: Download Docker image artifact
uses: actions/download-artifact@v3
with:
name: docker-image
path: .
- name: Checkout
uses: actions/checkout@v3

- name: Load Docker image
run: |
gunzip -c rjknightmare-fo-ci-test-latest.tar.gz | docker load
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Run Fossology Scanner
- name: Docker command
run: |
docker run --rm --name "fossologyscanner" -w "/opt/repo" -v ${PWD}:/opt/repo \
-e GITHUB_TOKEN=${{ github.token }} \
Expand All @@ -57,46 +24,70 @@ jobs:
-e GITHUB_REPO_OWNER=${{ github.repository_owner }} \
-e GITHUB_API=${{ github.api_url }} \
-e GITHUB_ACTIONS \
fossology/fossology:scanner "/bin/fossologyscanner" nomos ojo
rjknightmare/fo-ci-test:latest "/bin/fossologyscanner" nomos ojo

- name: Run fossology scanner with differential mode
if: ${{ vars.FROM_TAG != '' }} && ${{ vars.TO_TAG != '' }}
run : |
docker run --rm --name "fossologyscanner" -w "/opt/repo" -v ${PWD}:/opt/repo \
-e GITHUB_TOKEN=${{ github.token }} \
-e GITHUB_PULL_REQUEST=${{ github.event.number }} \
-e GITHUB_REPOSITORY=${{ github.repository }} \
-e GITHUB_API=${{ github.api_url }} \
-e GITHUB_REPO_URL=${{ github.repositoryUrl }} \
-e GITHUB_REPO_OWNER=${{ github.repository_owner }} \
-e GITHUB_ACTIONS \
rjknightmare/fo-ci-test:diff "/bin/fossologyscanner" nomos ojo \
differential --tags ${{ vars.FROM_TAG }} ${{ vars.TO_TAG }}

check-copyright:
name: Check copyright
runs-on: ubuntu-22.04
needs: build-docker-image
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Download Docker image artifact
uses: actions/download-artifact@v3
with:
name: docker-image
path: .
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Load Docker image
- name: Run Fossology Scanner with custom keywords
if: ${{ vars.KEYWORD_CONF_FILE_PATH != '' }}
run: |
gunzip -c rjknightmare-fo-ci-test-latest.tar.gz | docker load
docker run --rm --name "fossologyscanner" -w "/opt/repo" -v ${PWD}:/opt/repo \
-v ${{ github.workspace }}/${{ vars.KEYWORD_CONF_FILE_PATH }}:/bin/${{ vars.KEYWORD_CONF_FILE_PATH }} \
-e GITHUB_TOKEN=${{ github.token }} \
-e GITHUB_PULL_REQUEST=${{ github.event.number }} \
-e GITHUB_REPOSITORY=${{ github.repository }} \
-e GITHUB_API=${{ github.api_url }} \
-e GITHUB_REPO_URL=${{ github.repositoryUrl }} \
-e GITHUB_REPO_OWNER=${{ github.repository_owner }} \
-e GITHUB_ACTIONS \
rjknightmare/fo-ci-test:latest "/bin/fossologyscanner" copyright keyword \
--keyword-conf ${{ vars.KEYWORD_CONF_FILE_PATH }}

- name: Run Fossology Scanner
run: |
FILE_PATH=${{ github.event.inputs.file-path || '' }}
echo "$github.event.inputs.file-path"
if [ -n "$FILE_PATH" ]; then
docker run --rm --name "fossologyscanner" -w "/opt/repo" -v ${PWD}:/opt/repo \
-e GITHUB_TOKEN=${{ github.token }} \
-e GITHUB_PULL_REQUEST=${{ github.event.number }} \
-e GITHUB_REPOSITORY=${{ github.repository }} \
-e GITHUB_API=${{ github.api_url }} \
-e GITHUB_REPO_URL=${{ github.repositoryUrl }} \
-e GITHUB_REPO_OWNER=${{ github.repository_owner }} \
-e GITHUB_ACTIONS \
rjknightmare/fo-ci-test:latest "/bin/fossologyscanner" copyright keyword --keyword-conf "$FILE_PATH"
else
docker run --rm --name "fossologyscanner" -w "/opt/repo" -v ${PWD}:/opt/repo \
-e GITHUB_TOKEN=${{ github.token }} \
-e GITHUB_PULL_REQUEST=${{ github.event.number }} \
-e GITHUB_REPOSITORY=${{ github.repository }} \
-e GITHUB_API=${{ github.api_url }} \
-e GITHUB_REPO_URL=${{ github.repositoryUrl }} \
-e GITHUB_REPO_OWNER=${{ github.repository_owner }} \
-e GITHUB_ACTIONS \
rjknightmare/fo-ci-test:latest "/bin/fossologyscanner" copyright keyword
- name: Run fossology scanner
if: ${{ vars.KEYWORD_CONF_FILE_PATH == '' }}
run : |
docker run --rm --name "fossologyscanner" -w "/opt/repo" -v ${PWD}:/opt/repo \
-e GITHUB_TOKEN=${{ github.token }} \
-e GITHUB_PULL_REQUEST=${{ github.event.number }} \
-e GITHUB_REPOSITORY=${{ github.repository }} \
-e GITHUB_API=${{ github.api_url }} \
-e GITHUB_REPO_URL=${{ github.repositoryUrl }} \
-e GITHUB_REPO_OWNER=${{ github.repository_owner }} \
-e GITHUB_ACTIONS \
rjknightmare/fo-ci-test:latest "/bin/fossologyscanner" copyright keyword

- name: Run fossology scanner with differential mode
if: ${{ vars.FROM_TAG != '' }} && ${{ vars.TO_TAG != '' }}
run : |
docker run --rm --name "fossologyscanner" -w "/opt/repo" -v ${PWD}:/opt/repo \
-e GITHUB_TOKEN=${{ github.token }} \
-e GITHUB_PULL_REQUEST=${{ github.event.number }} \
-e GITHUB_REPOSITORY=${{ github.repository }} \
-e GITHUB_API=${{ github.api_url }} \
-e GITHUB_REPO_URL=${{ github.repositoryUrl }} \
-e GITHUB_REPO_OWNER=${{ github.repository_owner }} \
-e GITHUB_ACTIONS \
rjknightmare/fo-ci-test:diff "/bin/fossologyscanner" copyright keyword \
differential --tags ${{ vars.FROM_TAG }} ${{ vars.TO_TAG }}
9 changes: 0 additions & 9 deletions .github/workflows/test_actions_via_ssh.yaml

This file was deleted.

70 changes: 70 additions & 0 deletions .gitlab.sample.workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SPDX-FileCopyrightText: © 2020 Siemens AG
# SPDX-FileCopyrightText: © anupam.ghosh@siemens.com
# SPDX-FileCopyrightText: © gaurav.mishra@siemens.com

# SPDX-License-Identifier: FSFAP

stages:
- license

license_check:
stage: license
image: rjknightmare/fo-ci-test:latest
script:
- /bin/fossologyscanner nomos ojo
only: [merge_requests]
artifacts:
paths:
- results
expire_in: 1 week
when: on_failure

copyright_check:
stage: license
image: rjknightmare/fo-ci-test:latest
before_script:
- echo "$KEYWORD_CONF_FILE_PATH"
script:
- >
if [ -n "$KEYWORD_CONF_FILE" ]; then
/bin/fossologyscanner copyright keyword --keyword-conf "$KEYWORD_CONF_FILE_PATH"
else
/bin/fossologyscanner copyright keyword
fi
only: [merge_requests]
artifacts:
paths:
- results
expire_in: 1 week
when: on_failure

repo_license_scan:
stage: license
image: rjknightmare/fo-ci-test:latest
script:
- /bin/fossologyscanner repo nomos ojo --report SPDX_JSON
only: [tags]
artifacts:
paths:
- results
expire_in: 1 week
when: always
#
repo_sbom:
stage: license
image: rjknightmare/fo-ci-test:latest
before_script:
- echo "$KEYWORD_CONF_FILE_PATH"
script:
- >
if [ -n "$KEYWORD_CONF_FILE" ]; then
/bin/fossologyscanner copyright keyword repo nomos ojo --report SPDX_JSON --keyword-conf "$KEYWORD_CONF_FILE_PATH"
else
/bin/fossologyscanner copyright keyword repo nomos ojo --report SPDX_JSON
fi
only: [tags]
artifacts:
paths:
- results
expire_in: 1 week
when: always
6 changes: 4 additions & 2 deletions BrainByte/chatbot/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
)


# orthogonally testing my new keyword

def format_prompt(message, history):
prompt = "<s>"
for user_prompt, bot_response in history:
Expand Down Expand Up @@ -41,7 +43,7 @@ def generate(
yield output
return output


# Copyright 2024 @ Test 3 <test_3@gmail.com>
additional_inputs=[
gr.Slider(
label="Temperature",
Expand Down Expand Up @@ -88,7 +90,7 @@ def generate(
border: 1px solid #ccc;
}
"""

# owned_by Rajul Jha
with gr.Blocks(css=css) as app:
gr.HTML("<h1><center>EduAI Chatbot</center></h1>")
gr.HTML("<h3><center>Welcome to your own chatbot</center></h3>")
Expand Down
1 change: 1 addition & 0 deletions BrainByte/courses/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
licensed under MIT License New and GPL License Also New Test
2 changes: 2 additions & 0 deletions BrainByte/eduai/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

User = get_user_model()

# housing under Rajul Jha Corporation nonsense comment.. haha

class Question(models.Model):
text = models.TextField()
question_type = models.CharField(max_length=255)
Expand Down
3 changes: 3 additions & 0 deletions BrainByte/home/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from django.contrib import admin

# Register your models here.

# SPDX-FileContributor: Gaurav Mishra <mishra.gaurav@siemens.com>
# Copyright 2024 @ Test <test@gmail.com>
1 change: 1 addition & 0 deletions BrainByte/home/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.test import TestCase

# Create your tests here.
# Copyright 2024 @ Test_2 <test_2@gmail.com>
4 changes: 2 additions & 2 deletions BrainByte/templates/courses/playlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ <h2 class="text-center text-3xl font-bold mb-10">{{ topic_name }}</h2>
href="{{ course.link }}"
target="_blank"
class="inline-block bg-black text-white rounded-full px-3 py-1 text-sm font-semibold mr-2 mb-2"
>Watch on YouTube</a
>
>Watch on YouTube</a>
{% comment %} Licensed under MIT license {% endcomment %}
</div>
</div>
{% empty %}
Expand Down
4 changes: 4 additions & 0 deletions BrainByte/templates/home/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body class="font-mono">
<header>

{% comment %} Copyright 2024 @ Batman {% endcomment %}

<nav class="bg-black text-white">
<div
class="container mx-auto px-4 py-4 flex justify-between items-center"
Expand Down Expand Up @@ -56,3 +59,4 @@ <h3 class="font-bold text-lg mb-4">Follow Us</h3>
</footer>
</body>
</html>
{% comment %} Protected by Batman {% endcomment %}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
## Support

For any inquiries or support requests, please contact us at [rajuljha](https://github.com/rajuljha) or [tayyab-ilyas](https://github.com/tayyab-ilyas)


stolen from
stolen
patented
licenses by
4 changes: 4 additions & 0 deletions SIH/cloudinary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env
.vscode
__pychache__
cloudinary
Binary file not shown.
Binary file added SIH/cloudinary/__pycache__/upload.cpython-311.pyc
Binary file not shown.
19 changes: 19 additions & 0 deletions SIH/cloudinary/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from flask import Flask, render_template
from retrieve import get_img_url_from_db
from upload import upload_img_to_db

app = Flask(__name__)

@app.route("/",methods=['POST','GET'])
def home():
img_url = get_img_url_from_db()
return render_template('home.html',img_url=img_url)

@app.route('/upload', methods=['POST'])
def handle_upload():
upload_img_to_db()
return 'Image uploaded successfully!'


if __name__ == "__main__":
app.run(debug=True)
12 changes: 12 additions & 0 deletions SIH/cloudinary/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
blinker==1.6.2
certifi==2023.7.22
click==8.1.7
cloudinary==1.35.0
Flask==2.3.3
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
python-dotenv==1.0.0
six==1.16.0
urllib3==1.26.16
Werkzeug==2.3.7
Loading
Loading