-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang] Do less advertising for unresolved issues in cxx_dr_status.html
#78836
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
Changes from all commits
c931f87
5a2caa9
b814c10
3097452
d60297a
222a7d7
645f41e
88c74c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,19 +129,25 @@ out_file.write('''\ | |
|
||
latest_release = 17 | ||
|
||
class AvailabilityError(RuntimeError): | ||
pass | ||
|
||
availability_error_occurred = False | ||
|
||
def availability(issue): | ||
status = status_map.get(issue, 'unknown') | ||
|
||
unresolved_status = '' | ||
if status.endswith(' open'): | ||
status = status[:-5] | ||
unresolved_status = 'open' | ||
elif status.endswith(' drafting'): | ||
status = status[:-9] | ||
unresolved_status = 'drafting' | ||
elif status.endswith(' review'): | ||
status = status[:-7] | ||
unresolved_status = 'review' | ||
proposed_resolution = '' | ||
unresolved_status_match = re.search(r' (open|drafting|review)', status) | ||
if unresolved_status_match: | ||
unresolved_status = unresolved_status_match.group(1) | ||
proposed_resolution_match = re.search(r' (open|drafting|review) (\d{4}-\d{2}(?:-\d{2})?|P\d{4}R\d+)$', status) | ||
if proposed_resolution_match is None: | ||
raise AvailabilityError('Issue {}: \'{}\' status should be followed by a paper number (P1234R5) or proposed resolution in YYYY-MM-DD format'.format(dr.issue, unresolved_status)) | ||
proposed_resolution = proposed_resolution_match.group(2) | ||
status = status[:-1-len(proposed_resolution)] | ||
status = status[:-1-len(unresolved_status)] | ||
|
||
avail_suffix = '' | ||
if status.endswith(' c++11'): | ||
|
@@ -159,21 +165,37 @@ def availability(issue): | |
if status == 'unknown': | ||
avail = 'Unknown' | ||
avail_style = ' class="unknown"' | ||
elif re.match('^[0-9]+\.?[0-9]*', status): | ||
avail = 'Clang %s' % status | ||
if float(status) > latest_release: | ||
avail_style = ' class="unreleased"' | ||
else: | ||
avail_style = ' class="full"' | ||
elif re.match(r'^[0-9]+\.?[0-9]*', status): | ||
if not proposed_resolution: | ||
avail = 'Clang %s' % status | ||
if float(status) > latest_release: | ||
avail_style = ' class="unreleased"' | ||
else: | ||
avail_style = ' class="full"' | ||
else: | ||
avail = 'Not Resolved*' | ||
avail_style = f' title="Clang {status} implements {proposed_resolution} resolution"' | ||
elif status == 'yes': | ||
avail = 'Yes' | ||
avail_style = ' class="full"' | ||
if not proposed_resolution: | ||
avail = 'Yes' | ||
avail_style = ' class="full"' | ||
else: | ||
avail = 'Not Resolved*' | ||
avail_style = f' title="Clang implements {proposed_resolution} resolution"' | ||
elif status == 'partial': | ||
avail = 'Partial' | ||
avail_style = ' class="partial"' | ||
if not proposed_resolution: | ||
avail = 'Partial' | ||
avail_style = ' class="partial"' | ||
else: | ||
avail = 'Not Resolved*' | ||
avail_style = f' title="Clang partially implements {proposed_resolution} resolution"' | ||
elif status == 'no': | ||
avail = 'No' | ||
avail_style = ' class="none"' | ||
if not proposed_resolution: | ||
avail = 'No' | ||
avail_style = ' class="none"' | ||
else: | ||
avail = 'Not Resolved*' | ||
avail_style = f' title="Clang does not implement {proposed_resolution} resolution"' | ||
Comment on lines
+193
to
+198
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the no case, I would leave it unknown / no comment... that we don't do something is not useful information for users. WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see why we don't want to report this, if we report that some unresolved issues are available. For instance, I find it useful to mention that we test proposed resolution for 2335, and decided it's not available. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tend to agree; if we're telling users "there's some drafting and we do what the drafting said as of XXX", then there's similar value in telling users "there's some drafting and we do not do what the drafting said as of XXX" (for example, as the issue is resolved, it tells us that we can convert it into a No instead of an Unknown). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't agree (because telling users we don;t do something does not tell them what we do), but I will bow to whatever decision @AaronBallman takes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should leave it. I agree that it doesn't tell users what we're actually doing, but the point here is more for a user who reads the draft wording and says "Clang isn't doing what that says, is that a bug?" without really realizing that "drafting" status may mean we don't want to work on the issue until a final decision has been reached. If we explicitly say "we don't do what the current drafting says", it at least tells the user "we're aware of the issue, don't expect us to do what the current drafting says". |
||
elif status == 'na': | ||
avail = 'N/A' | ||
avail_style = ' class="na"' | ||
|
@@ -200,7 +222,7 @@ def availability(issue): | |
avail = 'Duplicate of <a href="#%s">%s</a>' % (dup, dup) | ||
_, avail_style, _ = availability(dup) | ||
else: | ||
assert False, 'unknown status %s for issue %s' % (status, dr.issue) | ||
raise AvailabilityError('Unknown status %s for issue %s' % (status, dr.issue)) | ||
return (avail + avail_suffix, avail_style, unresolved_status) | ||
|
||
count = {} | ||
|
@@ -217,20 +239,36 @@ for dr in drs: | |
|
||
elif dr.status in ('open', 'drafting', 'review'): | ||
row_style = ' class="open"' | ||
avail, avail_style, unresolved_status = availability(dr.issue) | ||
try: | ||
avail, avail_style, unresolved_status = availability(dr.issue) | ||
except AvailabilityError as e: | ||
availability_error_occurred = True | ||
print(e.args[0]) | ||
continue | ||
|
||
if avail == 'Unknown': | ||
avail = 'Not resolved' | ||
avail_style = '' | ||
else: | ||
assert unresolved_status == dr.status, \ | ||
"Issue %s is marked '%s', which differs from CWG index status '%s'" \ | ||
% (dr.issue, unresolved_status, dr.status) | ||
if unresolved_status != dr.status: | ||
availability_error_occurred = True | ||
print("Issue %s is marked '%s', which differs from CWG index status '%s'" \ | ||
% (dr.issue, unresolved_status, dr.status)) | ||
continue | ||
else: | ||
row_style = '' | ||
avail, avail_style, unresolved_status = availability(dr.issue) | ||
assert not unresolved_status, \ | ||
"Issue %s is marked '%s', even though it is resolved in CWG index" \ | ||
% (dr.issue, unresolved_status) | ||
try: | ||
avail, avail_style, unresolved_status = availability(dr.issue) | ||
except AvailabilityError as e: | ||
availability_error_occurred = True | ||
print(e.args[0]) | ||
continue | ||
|
||
if unresolved_status: | ||
availability_error_occurred = True | ||
print("Issue %s is marked '%s', even though it is resolved in CWG index" \ | ||
% (dr.issue, unresolved_status)) | ||
continue | ||
|
||
if not avail.startswith('Sup') and not avail.startswith('Dup'): | ||
count[avail] = count.get(avail, 0) + 1 | ||
|
@@ -243,6 +281,9 @@ for dr in drs: | |
<td%s align="center">%s</td> | ||
</tr>''' % (row_style, dr.issue, dr.issue, dr.issue, dr.status, dr.title, avail_style, avail)) | ||
|
||
if availability_error_occurred: | ||
exit(1) | ||
|
||
for status, num in sorted(count.items()): | ||
print("%s: %s" % (status, num), file=sys.stderr) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this case happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have examples at the moment, but I think it's possible to only partially implement a proposed resolution in the same way one can partially implement an approved resolution:
// dr1234: partial drafting 2024-02-13
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine keeping it on the assumption it might be used in the future, but I'm also fine stripping it out on the assumption that it's easy enough to add support for once we have an actual need for it.