Skip to content
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

Extension Naming and Versioning #13

Merged
merged 10 commits into from
Aug 18, 2020
Merged

Extension Naming and Versioning #13

merged 10 commits into from
Aug 18, 2020

Conversation

neilsjefferies
Copy link
Member

Clarified versioning/maintenance text in response to issue #4 (plus a couple of formatting/language fixes)

Clarify versioning and some tidying up
Clarified wording around maintenance
README.md Outdated

## Referencing Parameters

Wherever a parameterised extension is referenced, include any parameters in an accompanying JSON file. If using an extensions directory, the JSON file MUST be named for the extension and included in the directory. For example, the example extension above would have an accompanying file *0000-example-extension.json* which might contain:
Wherever a parameterised extension is referenced, any parameters MAY be included in an accompanying JSON file. If using an extensions directory, the JSON file MUST be named for the extension and included in the directory. For example, the example extension above would have an accompanying file *0000-example-extension.json* which might contain:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused by this wording:

If using an extensions directory, the JSON file MUST be named for the extension and included in the directory.

  1. Is it acceptable to put these JSON files anywhere other than in the extensions directory?
  2. If it is put inside the extensions directory, does it matter where? For example, extensions/0000-example-extension.json or extensions/0000-example-extension/0000-example-extension.json.

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. At the moment, there isn't another way of referencing extensions other than the extension directory so no.
  2. Interesting point, the intent was the extension directory and not a subdirectory.

Copy link
Member Author

Choose a reason for hiding this comment

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

Clarified that it needs to be in the extension directory and not a subdirectory. Also, ocfl_layout.json is another place where a parameter sidecar file can occur.

Copy link
Contributor

Choose a reason for hiding this comment

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

@neilsjefferies Thanks for the updates!

The spec currently states that extensions should use a subdirectory of extensions "named according to a registered extension name". I don't necessary have a problem with the json files being directly under extensions. In fact, for extensions that do not have additional files, this makes a lot of sense. But, it is a little more awkward for extensions that have both configuration and a sub directory. For example:

extensions/
 - 0000-example-extension.json
 - 0000-example-extension/
    - ... some files ...

In those cases, it would be neater if the json file was under the extension directory. Perhaps, the json file should be at the root of extensions when the extension has no other files and under a subdirectory if it does? Not a huge deal either way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I agree! I intended that the extension parameters should be in the "root directory of the extension" not extensions since it shouldn't contain files as per the spec. Let me reword that...

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me too

In order to have an additional digest algorithm listed here, please submit a pull request on this extension that adds it to the table. New entries should have a name that does not conflict with those defined in the [OCFL Specification](https://ocfl.io/latest/spec/) or this community extension, and is preferably in common use for the given algorithm. In the case that long description is required it may be appropriate to submit a new extension describing the algorithm along with an update to this extension that links to it.
In order to have an additional digest algorithm listed here, please submit a pull request on this extension that:
* Adds the algorithm to the table. New entries should have a name that does not conflict with those defined in the [OCFL Specification](https://ocfl.io/latest/spec/) or this community extension, and is preferably in common use for the given algorithm.
* Creates a new version of this extension with the next available extension number, obsoleting the current one
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume that this extension is no longer going to be parameterized, correct? So, there's effectively no way to reference it. Does it matter if a new version of this extension was created opposed to just updating it? If a new version was created, how would anyone know which version an object was using?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe it will be parameterized but the PR hasn't been merged yet. Editors discussed versioning and decided to hold with RFC behaviour and create new extension numbers for additions. A new version doesn't cause the old one to vanish. Whatever version an object references will continue to be valid.

Copy link
Member Author

Choose a reason for hiding this comment

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

Update post 20200602 Editorial discussion. We're not parameterizing but the versioning description remains to be consistent with how extensions are handled in in general.

@neilsjefferies neilsjefferies changed the title Versioning Extension Naming and Versioning Jun 16, 2020
@neilsjefferies
Copy link
Member Author

Updated to define registered name.

README.md Outdated
Wherever a parameterised extension is referenced, include any parameters in an accompanying JSON file. If using an extensions directory, the JSON file MUST be named for the extension and included in the directory. For example, the example extension above would have an accompanying file *0000-example-extension.json* which might contain:
Wherever a parameterised extension is referenced, any parameters MAY be included in an accompanying sidecar JSON file that
uses the registered name with the filename extension `.json`. If using an 'extensions' directory, the JSON file MUST be
included at the top level of the directory and not a subdirectory. Another place that an extension may be referenced is
Copy link
Contributor

Choose a reason for hiding this comment

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

Another place that an extension may be referenced is ocfl_layout.json where the sidecar file should be alongside it in the Storage Root.

Is this the equivalent of saying?

If ocfl_layout.json references an extension, then the extension's sidecar file must be in the Storage Root instead of the extensions directory.

Or should both locations be checked?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes (to your first question).

included at the top level of the directory and not a subdirectory. Another place that an extension may be referenced is
`ocfl_layout.json` where the sidecar file should be alongside it in the Storage Root.

For example, the example extension above would have an accompanying file *0000-example-extension.json* which might contain:

"0000-example-extension.md": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps not appropriate for this PR, but I'm not sure the parameters json file should have this key "0000-example-extension.md". Wouldn't the contents of 0000-example-extension.md (in this example) be:

{
    "firstExampleParameter": 12,  
    "secondExampleParameter": "Hello",  
    "thirdExampleParameter": "Green"  
}

Copy link
Member

Choose a reason for hiding this comment

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

I can see potential value in keeping the extension name as the key in this JSON document... particularly in the case where an extension is chaining multiple other extensions together.
..or, for the chaining use case, the chained extensions may also be found in the parameter listing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unless there's an intention to suggest that you could define multiple extensions in the same file, I don't think there's much value in keeping the key, which makes parsing a little kludgy. I'm not sure it would even work for chaining because you can't infer an ordinal relationship.

Copy link
Member

Choose a reason for hiding this comment

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

If the reasons for keeping the key are hypothetical, at best... maybe it should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is the only change that is being requested in this PR, perhaps we could allow this PR to move forward and make the change in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rosy1280, @neilsjefferies had expressed the intent to clarify the language around where the json file is supposed to be written: #13 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

But, yes, the key doesn't necessarily need to be addressed here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Parking this for a later pull request.

Copy link
Contributor

Choose a reason for hiding this comment

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

@pwinckles can you create a ticket for this issue? (or did you already?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Done: #22

awoods
awoods previously requested changes Jul 21, 2020
README.md Outdated
have the `.md` extension; and have a maximum of 250 characters. New, or substantially revised, extensions MUST use the next
available number based on extensions current at the time of merging.

The *Registered Name* of an extension is the name of the extension file in the `docs` directory, excluding the `.md` extension.
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest the "Registered Name" to be the name provided in the header (https://github.com/OCFL/extensions/pull/16/files#diff-77315547024f9923f13fb0a37b4ecf3aR3), as opposed to the filename in the docs directory.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, but do we then need some language saying that the extension file is also named according to the registered extension name?

Copy link
Member

Choose a reason for hiding this comment

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

@zimeon : Are you suggesting wording that aligns the filename with the registered extension name? If so, that sounds reasonable.

* boolean - MUST have the value *false* or *true* (lower case and unquoted as in JSON)
* Range: Further qualifies the valid values for a parameter depending on its type.
* For integer parameters, the range specifies minimum and maximum values, separated by a comma, which MUST be integers themselves.
* For string parameters, the range specifies the maximum length of the string as an integer number of characters, not bytes. Again, based on a survey of parsers, strings SHOULD be shorter than 4095 characters.
Copy link
Member

Choose a reason for hiding this comment

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

I would expect the range for string parameters to somehow define the allowable values. Would a regex or enumerated list make sense? I am not sure I see the benefit of using the range property to define string lengths.

Copy link
Contributor

@rosy1280 rosy1280 Aug 18, 2020

Choose a reason for hiding this comment

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

Parking this for a later pull request.

Copy link
Contributor

Choose a reason for hiding this comment

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

@awoods to create an issue for discussion

included at the top level of the directory and not a subdirectory. Another place that an extension may be referenced is
`ocfl_layout.json` where the sidecar file should be alongside it in the Storage Root.

For example, the example extension above would have an accompanying file *0000-example-extension.json* which might contain:

"0000-example-extension.md": {
Copy link
Member

Choose a reason for hiding this comment

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

I can see potential value in keeping the extension name as the key in this JSON document... particularly in the case where an extension is chaining multiple other extensions together.
..or, for the chaining use case, the chained extensions may also be found in the parameter listing.

Updated Registered name definition and specified parameter location more clearly.
@rosy1280 rosy1280 removed the request for review from ahankinson August 18, 2020 13:18
@rosy1280 rosy1280 merged commit 25f8921 into master Aug 18, 2020
@rosy1280 rosy1280 deleted the Versioning branch August 18, 2020 13:20
@rosy1280 rosy1280 restored the Versioning branch August 18, 2020 13:25
@rosy1280 rosy1280 deleted the Versioning branch August 18, 2020 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants