Skip to content

Add FileAttributes.None - #89130

Merged
adamsitnik merged 2 commits into
dotnet:mainfrom
meziantou:fileattributes-none
Aug 2, 2023
Merged

Add FileAttributes.None#89130
adamsitnik merged 2 commits into
dotnet:mainfrom
meziantou:fileattributes-none

Conversation

@meziantou

Copy link
Copy Markdown
Contributor

@ghost

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghostghost added the community-contribution Indicates that the PR has been added by a community member label Jul 18, 2023
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix #83125

Author:meziantou
Assignees:-
Labels:

area-System.IO, new-api-needs-documentation

Milestone:-

@stephentoub

Copy link
Copy Markdown
Member

Thanks

Comment on lines +189 to +190
json = JsonSerializer.Serialize((FileAttributes)(-1), options);
Assert.Equal(@"-1", json);

@meziantoumeziantouJul 19, 2023

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the previous test was validating that an unknown value is serialized as a number.

FileAttributes.Compressed & FileAttributes.Device is now None. So, the test fails on net8 but succeeds on net462. I replaced the value with an unknown value (-1).

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for your contribution @meziantou !

@adamsitnik

Copy link
Copy Markdown
Member

@meziantou could you please sync your branch with upstream? It should get the CI green

@adamsitnik

Copy link
Copy Markdown
Member

@jeffhandley I request for the permission to merge (it's nice to have, the risk is very low)

@meziantou

Copy link
Copy Markdown
ContributorAuthor

@adamsitnik the build is still red after synching the branch, but there are less errors.

@adamsitnik

Copy link
Copy Markdown
Member

I'll close the PR and open it again, as the CI has not cancelled a very long running leg:

image

@adamsitnikadamsitnik reopened this Aug 1, 2023

@jeffhandleyjeffhandley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve of merging this in for RC1. It's a nice value-add with low risk.

@adamsitnik
adamsitnik merged commit 23f7dbd into dotnet:mainAug 2, 2023
@adamsitnikadamsitnik added this to the 8.0.0 milestone Aug 2, 2023
@meziantou
meziantou deleted the fileattributes-none branch August 2, 2023 13:42
@ghostghost locked as resolved and limited conversation to collaborators Sep 1, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.IOcommunity-contributionIndicates that the PR has been added by a community membernew-api-needs-documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Add FileAttributes.None

4 participants

@meziantou@stephentoub@adamsitnik@jeffhandley