• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / ecosystem / 29663486057

18 Jul 2026 10:27PM UTC coverage: 70.644%. First build
29663486057

Pull #1249

github

web-flow
Merge c2c0cbe47 into 2e41a9e8a
Pull Request #1249: new checkup `[G11]` - Unmaintaned projects should be archived when the repository is on an IBM-controlled organization

4 of 13 new or added lines in 3 files covered. (30.77%)

1930 of 2732 relevant lines covered (70.64%)

0.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.93
/ecosystem/validation/test_github.py
1
# This code is part of Qiskit.
2
#
3
# (C) Copyright IBM 2023.
4
#
5
# This code is licensed under the Apache License, Version 2.0. You may
6
# obtain a copy of this license in the LICENSE.txt file in the root directory
7
# of this source tree or at https://www.apache.org/licenses/LICENSE-2.0.
8
#
9
# Any modifications or derivative works of this code must retain this
10
# copyright notice, and modified files need to carry a notice indicating
11
# that they have been altered from the originals.
12

13
"""Validations involving section member.github"""
1✔
14

15
# pylint: disable=invalid-name,missing-function-docstring
16

17
from datetime import date
1✔
18
from dateutil.relativedelta import relativedelta
1✔
19

20
import pytest
1✔
21

22
from . import ibm_controlled_gh_org
1✔
23

24

25
@pytest.fixture(autouse=True)
1✔
26
def skip_github(member):
1✔
27
    """Skip if no github section"""
28
    if member.github is None:
×
29
        pytest.skip("No github section")
×
30
    yield member
×
31

32

33
def test_G05(member):
1✔
34
    """GitHub repository is archived?"""
35
    if hasattr(member.github, "archived") and member.github.archived:
×
36
        assert hasattr(
×
37
            member, "maturity"
38
        ), "GitHub repository archived, so member.maturity must exist and be `as-is`"
39
        assert member.maturity in [
×
40
            "as-is",
41
            "unmaintaned",
42
        ], "GitHub repository archived and member.maturity is not `as-is` or `unmaintaned`"
43

44

45
def test_G06(member):
1✔
46
    """Have maintainer activity within the last 6 months"""
47
    if member.maturity == "as-is":
×
48
        pytest.skip("`as-is` projects are exempt from activity checks")
×
49

50
    last_activity = member.github.last_activity
×
51
    if last_activity is None:
×
52
        pytest.skip("No member.github.last_activity date")
×
53

54
    relative = relativedelta(date.today(), last_activity)
×
55
    months_difference = (relative.years * 12) + relative.months
×
56

57
    assert months_difference <= 6, (
×
58
        f"Last activity was {months_difference} months ago, which is more "
59
        "than 6 months ago. Please update the GitHub repository or set "
60
        "member.maturity to `as-is`."
61
    )
62

63

64
def test_G07(member):
1✔
65
    """Have last commit within the last 18 months"""
66
    if member.maturity == "as-is":
×
67
        pytest.skip("`as-is` projects are exempt from activity checks")
×
68

69
    last_commit = member.github.last_commit
×
70
    if last_commit is None:
×
71
        pytest.skip("No member.github.last_commit date")
×
72

73
    relative = relativedelta(date.today(), last_commit)
×
74
    months_difference = (relative.years * 12) + relative.months
×
75

76
    assert months_difference <= 18, (
×
77
        f"Last commit was {months_difference} months ago, which is more "
78
        "than 18 months ago. Please update the GitHub repository or set "
79
        "member.maturity to `as-is`."
80
    )
81

82

83
def test_G08(member):
1✔
84
    """Unmaintaned projects should archive their GitHub repository"""
85
    if member.maturity in ["deprecated", "unmaintaned"]:
×
86
        assert (
×
87
            member.github.archived
88
        ), "unsupported project should have an archived GitHub org"
89

90

91
def test_G09(member):
1✔
92
    if str(member.github.license) in ["None", "Other"]:
×
93
        assert (
×
94
            member.github.license.license_name is not None
95
        ), "member.github.license not detected"
96
        assert (
×
97
            member.github.license.license_name != "Other"
98
        ), "member.github.license not detected"
99

100

101
def test_G10(member):
1✔
102
    if member.github.license:
×
103
        if str(member.github.license) in ["None", "Other"]:
×
104
            pytest.skip("No member.github.license, already covered by [G09]")
×
105
        assert (
×
106
            member.github.license.is_osi_approved()
107
        ), "member.github.license is not OSI-approved"
108

109
def test_G11(member):
1✔
110
    """
111
    Unmaintaned projects should be archived when the repository is on an IBM-controlled organization"
112
    """
NEW
113
    if not hasattr(member, "github"):
×
NEW
114
        pytest.skip("member.github does not exist")
×
NEW
115
    if member.github.owner.lower() not in ibm_controlled_gh_org:
×
NEW
116
        pytest.skip("repository is on an IBM-controlled organization")
×
NEW
117
    archived = member.github.archived if hasattr(member.github, "archived") else False
×
NEW
118
    if archived:
×
NEW
119
        pytest.skip("project repository is already archived")
×
NEW
120
    if member.maturity in ["deprecated", "unmaintaned", "as-is"]:
×
NEW
121
        assert archived, (f"Unsupported project (`member.maturity == {member.maturity}`"
×
122
                          "should have an archived GitHub repository")
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc