Skip to content

Commit

Permalink
Fix submission process (#701)
Browse files Browse the repository at this point in the history
### Summary

The submission process was broken as some entries in the issue template
were being ignored by the parser. This PR fixes that and makes the
submission process more robust so similar issues don't occur in the
future.

### Details

Currently, to add a new field to the issue template, you need to edit
four different files to make sure the field makes it through to the
database. This PR avoids that by explicitly mapping field IDs in the
issue template to attributes of the repository model and writing the
entry immediately. After this change, you only need to edit the issue
template and the repository model.

I've also added a test check the fields in the issue template match
fields in the repository model.

---------

Co-authored-by: Eric Arellano <[email protected]>
  • Loading branch information
frankharkins and Eric-Arellano committed May 1, 2024
1 parent 2eae628 commit 4e298ff
Show file tree
Hide file tree
Showing 48 changed files with 160 additions and 214 deletions.
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ labels: ["submission"]
assignees:
- octocat
body:
# The IDs of each input must correspond with the attributes of the repository model
# in ecosystem/models/repository.py
- type: markdown
attributes:
value: |
Expand All @@ -29,7 +31,7 @@ body:
validations:
required: true
- type: input
id: repo
id: url
attributes:
label: Github repo
description: Link to GitHub repo of project you want to submit
Expand All @@ -53,7 +55,7 @@ body:
validations:
required: true
- type: input
id: contacts
id: contact_info
attributes:
label: Email
placeholder: [email protected]
Expand All @@ -68,7 +70,7 @@ body:
validations:
required: false
- type: dropdown
id: license
id: licence
attributes:
label: License
description: License for your project
Expand Down
25 changes: 2 additions & 23 deletions .github/workflows/ecosystem-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,14 @@ jobs:
id: parse-issue
env:
ISSUE_BODY: ${{ github.event.issue.body }}
run: python manager.py ci parser_issue --body="$ISSUE_BODY"
- name: Add member
env:
SUBMISSION_NAME: ${{ steps.parse-issue.outputs.SUBMISSION_NAME }}
SUBMISSION_REPO: ${{ steps.parse-issue.outputs.SUBMISSION_REPO }}
SUBMISSION_DESCRIPTION: ${{ steps.parse-issue.outputs.SUBMISSION_DESCRIPTION }}
SUBMISSION_LICENCE: ${{ steps.parse-issue.outputs.SUBMISSION_LICENCE }}
SUBMISSION_CONTACT: ${{ steps.parse-issue.outputs.SUBMISSION_CONTACT }}
SUBMISSION_ALTERNATIVES: ${{ steps.parse-issue.outputs.SUBMISSION_ALTERNATIVES }}
SUBMISSION_AFFILIATIONS: ${{ steps.parse-issue.outputs.SUBMISSION_AFFILIATIONS }}
SUBMISSION_LABELS: ${{ steps.parse-issue.outputs.SUBMISSION_LABELS }}
SUBMISSION_WEBSITE: ${{ steps.parse-issue.outputs.SUBMISSION_WEBSITE }}
run: |
python manager.py members add_repo_2db --repo_name="$SUBMISSION_NAME" \
--repo_link="$SUBMISSION_REPO" \
--repo_description="$SUBMISSION_DESCRIPTION" \
--repo_licence="$SUBMISSION_LICENCE" \
--repo_contact="$SUBMISSION_CONTACT" \
--repo_alt="$SUBMISSION_ALTERNATIVES" \
--repo_affiliations="$SUBMISSION_AFFILIATIONS" \
--repo_labels="$SUBMISSION_LABELS" \
--repo_website="$SUBMISSION_WEBSITE"
run: python manager.py ci add_member_from_issue --body="$ISSUE_BODY"

# Create PR
- name: Commit changes and create pull request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
commit-message: Submission - Add ${{ steps.parse-issue.outputs.SUBMISSION_REPO }} to list.
commit-message: Submission - Add ${{ steps.parse-issue.outputs.SUBMISSION_NAME }} to list.
title: Add ${{ steps.parse-issue.outputs.SUBMISSION_NAME }} to list.
body: |
Add ${{ steps.parse-issue.outputs.SUBMISSION_NAME }} to list.
Expand Down
41 changes: 13 additions & 28 deletions ecosystem/cli/ci.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""CliCI class for controlling all CLI functions."""
import os
from typing import Optional
from __future__ import annotations


from pathlib import Path

from ecosystem.daos import DAO
from ecosystem.utils import logger, parse_submission_issue
from ecosystem.utils import parse_submission_issue
from ecosystem.utils.utils import set_actions_output


Expand All @@ -17,37 +19,20 @@ class CliCI:
Ex: `python manager.py ci parser_issue --body="<SOME_MARKDOWN>"`
"""

def __init__(self, root_path: Optional[str] = None):
"""CliCI class."""
self.current_dir = root_path or os.path.abspath(os.getcwd())
self.resources_dir = "{}/ecosystem/resources".format(self.current_dir)
self.dao = DAO(path=self.resources_dir)
self.logger = logger

@staticmethod
def parser_issue(body: str) -> None:
"""Command for calling body issue parsing function.
def add_member_from_issue(body: str, *, resources_dir: str | None = None) -> None:
"""Parse an issue created from the issue template and add the member to the database
Args:
body: body of the created issue
resources_dir: (For testing) Path to the working directory
Returns:
logs output
We want to give the result of the parsing issue to the GitHub action
None (side effect is updating database and writing actions output)
"""

parsed_result = parse_submission_issue(body)
resources_dir = Path(resources_dir or (Path.cwd() / "ecosystem/resources"))

to_print = [
("SUBMISSION_NAME", parsed_result.name),
("SUBMISSION_REPO", parsed_result.url),
("SUBMISSION_DESCRIPTION", parsed_result.description),
("SUBMISSION_LICENCE", parsed_result.licence),
("SUBMISSION_CONTACT", parsed_result.contact_info),
("SUBMISSION_ALTERNATIVES", parsed_result.alternatives),
("SUBMISSION_AFFILIATIONS", parsed_result.affiliations),
("SUBMISSION_LABELS", parsed_result.labels),
("SUBMISSION_WEBSITE", parsed_result.website),
]

set_actions_output(to_print)
parsed_result = parse_submission_issue(body)
DAO(path=resources_dir).write(parsed_result)
set_actions_output([("SUBMISSION_NAME", parsed_result.name)])
12 changes: 8 additions & 4 deletions ecosystem/models/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@

@dataclass
class Repository(JsonSerializable):
"""Main repository class."""
"""Main repository class.
NOTE: These attribute names must correspond to field IDs in the issue
template (.github/ISSUE_TEMPLATE/submission.yml).
"""

# pylint: disable=too-many-instance-attributes
name: str
url: str
description: str
name: str | None = None
url: str | None = None
description: str | None = None
licence: str | None = None
contact_info: str | None = None
alternatives: str | None = None
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/QPong.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/HuangJunye/QPong"
description = "A quantum version of the classic game Pong built with Qiskit and PyGame"
licence = "Apache 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
labels = [ "Game",]
created_at = 1678827877.979398
updated_at = 1678827877.979398
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/QiskitOpt.jl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/psrenergy/QiskitOpt.jl"
description = "QiskitOpt.jl is a Julia package that exports a JuMP wrapper for qiskit-optimization."
licence = "MIT license"
contact_info = "[email protected], [email protected], [email protected], [email protected], [email protected]"
alternatives = "_No response_"
affiliations = "@psrenergy and USRA"
labels = [ "Algorithms", "Julia",]
created_at = 1673642669.650459
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/QoptKIT.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/SOQCSAdmin/QoptKIT"
description = "Optical circuits in Qiskit. Translate Qiskit circuits to quantum-optical circuits made of phase shifters and beamsplitters, simulate the circuit, then translate the outcome back to a qubit encoding."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "National University of Ireland Maynooth"
labels = [ "Circuit simulator",]
stars = 1
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/Quantum-Glasses.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ description = "Visualise the effects of single-qubit gates on a qubit via Bloch
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "The only alternative is to code up a circuit (qiskit.QuantumCircuit) and pass the circuit to visualize_transition from qiskit.visualization. Quantum Glasses implementation wraps all of this into a simple, easy to use Tkinter Software."
affiliations = "_No response_"
labels = [ "Visualization",]
stars = 15
group = "other"
1 change: 0 additions & 1 deletion ecosystem/resources/members/RasQberry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/JanLahmann/RasQberry"
description = "RasQberry is a functional model of IBM Quantum System One, and can run Qiskit on the integrated Raspberry Pi"
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
labels = [ "Game",]
created_at = 1674598082.072493
updated_at = 1674598082.072494
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/circuit-knitting-toolbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/Qiskit-Extensions/circuit-knitting-toolbox"
description = "Decompose large circuits into smaller, hardware-executable circuits, then use their results to reconstruct the original circuit's outcome. This toolbox includes entanglement forging, circuit knitting, and classical embedding."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
labels = [ "Algorithms", "Circuit",]
created_at = 1670427445.884067
updated_at = 1670427445.884068
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/dense-ev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/atlytle/dense-ev"
description = "Implements expectation value measurements in Qiskit using optimal dense grouping. Dense-ev provides an improvement of ~2^m over naive grouping and (3/2)^m over qubit-wise commuting groups."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "University of Illinois at Urbana-Champaign"
labels = [ "Paper implementation",]
stars = 7
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/resources/members/dsm-swap.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name = "dsm-swap"
url = "https://github.com/qiskit-community/dsm-swap"
description = "A doubly stochastic matrices-based approach to optimal qubit routing."
licence = "Apache License 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
labels = [ "Paper implementation", "Circuit",]
created_at = 1678827878.56605
updated_at = 1678827878.566051
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/resources/members/dynacir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name = "dynacir"
url = "https://github.com/derek-wang-ibm/dynacir"
description = "Dynacir is a transpilation plugin for Qiskit that optimizes dynamic quantum circuits."
licence = "Apache License 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "IBM Quantum"
labels = [ "Optimization", "Prototype",]
stars = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/JoelHBierman/electronic-structure-orbital-optimization
description = "Apply orbital optimization to quantum algorithms that solve electronic structure Hamiltonians. This collection of methods optimize the underlying basis set through orbital rotations, finding more accurate energies with fewer qubits."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "Duke University"
labels = [ "Algorithms", "Chemistry",]
stars = 0
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/resources/members/ffsim.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name = "ffsim"
url = "https://github.com/qiskit-community/ffsim"
description = "ffsim is a software library for simulating fermionic quantum circuits that conserve particle number and the Z component of spin."
licence = "Apache License 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "IBM"
labels = [ "Chemistry", "Circuit simulator", "IBM maintained", "Rust",]
website = "https://qiskit-community.github.io/ffsim/"
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/mirror-gates.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/Pitt-JonesLab/mirror-gates"
description = "MIRAGE is a transpilation plugin for quantum circuits that minimizes the use of SWAP gates while optimizing native basis gate decomposition through mirror gates. Specifically designed for iSWAP-based quantum systems, MIRAGE improves circuit depth, making quantum algorithms more practical and efficient."
licence = "MIT license"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "University of Pittsburgh"
labels = [ "Paper implementation",]
stars = 3
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/resources/members/openqasm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name = "OpenQASM"
url = "https://github.com/openqasm/openqasm"
description = "An imperative programming language for near-term quantum computing. Describe quantum programs by using the measurement-based quantum circuit model with support for classical feedforward flow control based on measurement outcomes."
licence = "Apache 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "OpenQASM specification contributors"
labels = [ "OpenQASM",]
created_at = 1660223774.444544
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/resources/members/purplecaffeine.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name = "PurpleCaffeine"
url = "https://github.com/IceKhan13/purplecaffeine"
description = "Project is aimed to create simple general interface to track quantum experiments, store and search them in an easy way."
licence = "Apache License 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "QAMP"
labels = [ "Productivity", "Jupyter notebook",]
created_at = 1688661859.080258
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/pyRiemann-qiskit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/pyRiemann/pyRiemann-qiskit"
description = "A library for supervised machine learning based on quantum computing and Riemannian geometry. The project is built on top of the Qiskit and pyRiemann projects and focuses on the classification of time series data."
licence = "BSD 3-Clause \"New\" or \"Revised\" license"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "pyRiemann (https://github.com/pyRiemann)"
labels = [ "Machine learning",]
stars = 21
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/qdao.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/Zhaoyilunnn/qdao"
description = "A lightweight framework to enable configurable memory consumption when simulating large quantum circuits."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "Institute of Computing Technology, Chinese Academy of Sciences."
labels = [ "Circuit simulator",]
stars = 7
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/qiskit-algorithms.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/qiskit-community/qiskit-algorithms"
description = "A library of quantum algorithms for near-term quantum devices with short-depth circuits."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "IBM Quantum"
labels = [ "Algorithms",]
stars = 77
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/qiskit-aqt-provider.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/qiskit-community/qiskit-aqt-provider"
description = "Qiskit provider for ion-trap quantum computers from Alpine Quantum Technologies (AQT)."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "Alpine Quantum Technologies GmbH"
labels = [ "Provider",]
website = "https://www.aqt.eu/qc-systems/"
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/qiskit-bip-mapper.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/qiskit-community/qiskit-bip-mapper"
description = "Solve the routing and layout problems as a binary integer programming (BIP) problem. This is an implementation of G. Nannicini et al. \"Optimal qubit assignment and routing via integer programming.\""
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "IBM"
labels = [ "Paper implementation",]
created_at = 1681306690.423614
Expand Down
3 changes: 0 additions & 3 deletions ecosystem/resources/members/qiskit-classroom-converter.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name = "qiskit-classroom-converter"
url = "https://github.com/KMU-quantum-classroom/qiskit-classroom-converter"
description = "Convert quantum circuits, matrices, and bra-ket strings. This converter includes the following conversion functions: quantum circuit to bra-ket notation, quantum circuit to matrix, matrix to quantum circuit, bra-ket notation to matrix."
licence = "Apache License 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "_No response_"
labels = [ "Converter",]
website = "https://github.com/KMU-quantum-classroom"
stars = 2
Expand Down
3 changes: 0 additions & 3 deletions ecosystem/resources/members/qiskit-classroom.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name = "qiskit-classroom"
url = "https://github.com/KMU-quantum-classroom/qiskit-classroom"
description = "Qiskit-classroom is a toolkit that helps implement quantum algorithms by converting and visualizing different expressions used in the Qiskit ecosystem using Qiskit-classroom-converter. The following three transformations are supported : Quantum circuit to Dirac notation, quantum circuit to matrix, matrix to quantum circuit etc."
licence = "Apache License 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "_No response_"
labels = [ "Visualization",]
website = "https://github.com/KMU-quantum-classroom"
stars = 2
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/resources/members/qiskit-metal-docker.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ url = "https://github.com/Dpbm/qiskit-metal-docker"
description = "A Docker image to run Qiskit Metal projects."
licence = "MIT license"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "_No response_"
labels = [ "Hardware",]
website = "https://dpbm.github.io/qiskit-metal-docker/"
stars = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ url = "https://github.com/mrossinek/qiskit-nature-pyscf-dft-embedding"
description = "This repository contains the latest prototype implementation of the Qiskit Nature + PySCF DFT Embedding. It is based on \"Quantum HF/DFT-embedding algorithms for electronic structure calculations: Scaling up to complex molecular systems\"."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "_No response_"
labels = [ "Algorithms", "Chemistry",]
created_at = 1685540348.208874
updated_at = 1685540348.208879
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/resources/members/qiskit-nature-pyscf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name = "Qiskit Nature PySCF"
url = "https://github.com/qiskit-community/qiskit-nature-pyscf"
description = "A third-party integration plugin of Qiskit Nature and PySCF."
licence = "Apache License 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
labels = [ "Chemistry",]
created_at = 1678827878.723733
updated_at = 1678827878.723734
Expand Down
3 changes: 0 additions & 3 deletions ecosystem/resources/members/qiskit-qec.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name = "Qiskit QEC"
url = "https://github.com/qiskit-community/qiskit-qec"
description = "For quantum error correction developers, experimentalists, and theorists."
licence = "Apache 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "_No response_"
labels = [ "Algorithms", "Error correction", "Circuit",]
created_at = 1662992390.122591
updated_at = 1662992390.122597
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/resources/members/qiskit-qubit-reuse.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name = "qiskit-qubit-reuse"
url = "https://github.com/qiskit-community/qiskit-qubit-reuse"
description = "A Qiskit transpiler stage plugin that reuses qubits through mid-circuit measurement and reset."
licence = "Apache License 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "IBM"
labels = [ "Paper implementation",]
stars = 11
Expand Down
1 change: 0 additions & 1 deletion ecosystem/resources/members/qiskit-qulacs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ url = "https://github.com/Gopal-Dahale/qiskit-qulacs"
description = "Qiskit-Qulacs allows users to execute Qiskit programs using Qulacs backend."
licence = "Apache License 2.0"
contact_info = "[email protected]"
alternatives = "_No response_"
affiliations = "Supported by the Unitary Fund microgrant program: https://unitary.fund/grants/"
labels = [ "Circuit simulator", "Converter", "Provider",]
stars = 8
Expand Down
3 changes: 0 additions & 3 deletions ecosystem/resources/members/qiskit-research.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name = "Qiskit Research"
url = "https://github.com/qiskit-community/qiskit-research"
description = "Run quantum computing research experiments by using Qiskit and IBM Quantum services, demonstrating best practices by example."
licence = "Apache 2.0"
contact_info = "_No response_"
alternatives = "_No response_"
affiliations = "_No response_"
labels = [ "Paper implementation",]
created_at = 1662992208.202283
updated_at = 1662992208.20229
Expand Down
Loading

0 comments on commit 4e298ff

Please sign in to comment.