Skip to content

Commit

Permalink
Merge branch 'main' into remove-source-link-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Feb 2, 2024
2 parents 5eb54aa + cdfce1b commit e0e4316
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 22 deletions.
71 changes: 49 additions & 22 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@ name: Bug Report
description: Report a bug to help us improve.
labels: [🐛 bug]
body:
- type: checkboxes
- type: markdown
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the issue you encountered. [Github Issue Tracker](https://github.com/ChilliCream/graphql-platform/issues)
options:
- label: I have searched the existing issues
required: true
value: |
**Before you start...**
This form is only for submitting bug reports. If you have a usage question
or are unsure if this is really a bug, make sure to:
- Read the [documentation](https://chillicream.com/docs)
- Ask on [Slack](https://slack.chillicream.com/)
- Look for / ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/hotchocolate)
Also try to search for your issue – it may have already been answered or even fixed in the main branch.
However, if you find that an old, closed issue still persists in the latest version,
you should open a new issue using the form below, instead of commenting on the old issue.
- type: dropdown
id: product
attributes:
Expand All @@ -21,21 +29,47 @@ body:
- Green Donut
validations:
required: true
- type: textarea
id: description
- type: input
id: version
attributes:
label: Version
description: What version of the selected product are you running?
placeholder: "12.0.0"
validations:
required: true
- type: input
id: reproduction-url
attributes:
label: Describe the bug
description: Also tell us, what did you expect to happen?
label: Link to minimal reproduction
description: |
Add the URL to a public Git repository or ZIP file.
The reproduction should be **minimal** - i.e. it should contain only the bare minimum amount of code needed
to show the bug.
Please do not just fill in a random link. The issue will be closed if no valid reproduction is provided.
placeholder: Reproduction URL
validations:
required: true
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: |
A list of steps that can be followed to recreate the bug.
If it cannot be described in simple steps, create a GitHub repository with code that clearly showcases the described bug. Include a link to the repository in the box below.
value: "1. "
What do we need to do after opening your reproduction in order to make the bug happen?
Clear and concise reproduction instructions are important for us to be able to triage your issue in a timely manner.
validations:
required: true
- type: textarea
id: expected
attributes:
label: What is expected?
validations:
required: true
- type: textarea
id: actual
attributes:
label: What is actually happening?
validations:
required: true
- type: textarea
Expand All @@ -47,18 +81,11 @@ body:
This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: additional-context
attributes:
label: Additional Context?
label: Additional context
description: |
Please add any other contextual information about the problem, that might be relevant and help explain the issue you're facing.
You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
- type: input
id: version
attributes:
label: Version
description: What version of the selected product are you running?
placeholder: "12.0.0"
validations:
required: true
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class XmlDocumentationProvider : IDocumentationProvider
private const string _cref = "cref";
private const string _href = "href";
private const string _code = "code";
private const string _paramref = "paramref";
private const string _name = "name";

private readonly IXmlDocumentationFileResolver _fileResolver;
private readonly ObjectPool<StringBuilder> _stringBuilderPool;
Expand Down Expand Up @@ -164,6 +166,17 @@ private static void AppendText(
continue;
}

if (currentElement.Name == _paramref)
{
var nameAttribute = currentElement.Attribute(_name);

if (nameAttribute != null)
{
description.Append(nameAttribute.Value);
continue;
}
}

if (currentElement.Name != _see)
{
description.Append(currentElement.Value);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace HotChocolate.Types.Descriptors
{
public class WithParamrefTagInXmlDoc
{
/// <summary>
/// This is a parameter reference to <paramref name="id"/>.
/// </summary>
public int Foo(int id) => id;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ public void When_description_has_see_tag_then_it_is_converted()
description);
}

[Fact]
public void When_description_has_paramref_tag_then_it_is_converted()
{
// arrange
var documentationProvider = new XmlDocumentationProvider(
new XmlDocumentationFileResolver(),
new NoOpStringBuilderPool());

// act
var description = documentationProvider.GetDescription(
typeof(WithParamrefTagInXmlDoc)
.GetMethod(nameof(WithParamrefTagInXmlDoc.Foo))!);

// assert
Assert.Equal(
"This is a parameter reference to id.",
description);
}

[Fact]
public void When_description_has_generic_tags_then_it_is_converted()
{
Expand Down
4 changes: 4 additions & 0 deletions templates/v12/server/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
{
"choice": "net7.0",
"description": "Target .NET 7"
},
{
"choice": "net8.0",
"description": "Target .NET 8"
}
],
"replaces": "net6.0",
Expand Down

0 comments on commit e0e4316

Please sign in to comment.