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

format specs with 4 spaces indent #846

Merged
merged 2 commits into from
Jun 1, 2017

Conversation

Mashimiao
Copy link

Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com

This MUST be unique across all containers on this host.
There is no requirement that it be unique across hosts.
This MUST be unique across all containers on this host.
There is no requirement that it be unique across hosts.
* **`status`** (string, REQUIRED) is the runtime state of the container.

Choose a reason for hiding this comment

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

I'm not sure what's happening, but when I view this document the bullet for the status line is a line above the word "status'
o
status

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 not sure if this will help, but I think the following “The value MAY be one of:” should be indented as well.

Copy link
Author

Choose a reason for hiding this comment

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

@TomSweeneyRedHat I'm not sure what's your browser. This may be that's the browser's problem. If you use another browser to view, does it look OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is a browser thing. Looking at the rendered HTML:

$ curl -s https://github.com/Mashimiao/specs/blob/3d92dd2a8907af6fbabe47caf2f04e8cf628b34f/runtime.md | grep -A10 -B10 status | head -n21
</a><ul><a name="user-content-runtimeState">
<li>
<p><strong><code>ociVersion</code></strong> (string, REQUIRED) is the OCI specification version used when creating the container.</p>
</li>
<li>
<p><strong><code>id</code></strong> (string, REQUIRED) is the container's ID.
This MUST be unique across all containers on this host.
There is no requirement that it be unique across hosts.</p>
</li>
</a><li><a name="user-content-runtimeState">
<p><strong><code>status</code></strong> (string, REQUIRED) is the runtime state of the container.
The value MAY be one of:</p>
</a><ul><a name="user-content-runtimeState">
</a><li><a name="user-content-runtimeState"><code>creating</code>: the container is being created (step 2 in the </a><a href="#lifecycle">lifecycle</a>)</li>
<li><code>created</code>: the runtime has finished the <a href="#create">create operation</a> (after step 2 in the <a href="#lifecycle">lifecycle</a>), and the container process has neither exited nor executed the user-specified program</li>
<li><code>running</code>: the container process has executed the user-specified program but has not exited (after step 5 in the <a href="#lifecycle">lifecycle</a>)</li>
<li><code>stopped</code>: the container process has exited (step 7 in the <a href="#lifecycle">lifecycle</a>)</li>
</ul>
<p>Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above.</p>
</li>
<li>

There are more user-content-runtimeState names than there should be, one of those <a> tags wraps the first two <li> entries, and only the status <li> entry gets some internal <p> tags. It seems like GitHub may be having issues with the partially-loose list, but according to their GFM spec (and this example), a single item with a blank line between two block-level elements should be enough to make the whole list loose.

So I think this is a GitHub rendering bug, and we should just accept the broken rendering until we can get GitHub's Markdown renderer patched. But it's probably worth washing this Markdown through Pandoc too to get a second opinion.

Copy link
Author

Choose a reason for hiding this comment

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

That may be a GitHub's bug. But different browsers have different views.
For example, chrome and firefox. By chrome, it looks OK

Choose a reason for hiding this comment

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

FWIW, I viewed this in Firefox and Chrome this morning. the issue did not show up in Chrome as you suspected. I'm fine with merging this as I agree it's a github/firefox rendering issue.

config.md Outdated
@@ -38,7 +38,8 @@ For example, if a configuration is compliant with version 1.1 of this specificat
On Linux, for example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`.

Choose a reason for hiding this comment

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

FWIW, I think these all should be sub-bullets.

o On Windows, ...
o On all other platforms, ...
o On Linux, ...
o If defined, ...

bundle.md Outdated
This REQUIRED file MUST reside in the root of the bundle directory and MUST be named `config.json`.
See [`config.json`](config.md) for more details.
This REQUIRED file MUST reside in the root of the bundle directory and MUST be named `config.json`.
See [`config.json`](config.md) for more details.

2. <a name="containerFormat02" />A directory representing the root filesystem of the container.
On Windows, for Windows Server containers, this directory is REQUIRED. For Hyper-V containers, it MUST be omitted.

Choose a reason for hiding this comment

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

I know it's not part of this review, but I think the "On Windows...", "For Hyper-V..." and "On all other ..." lines should be sub-bullets here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's not part of this review…

File a separate PR? Note that I have #838 and #840 in flight touching this requirement (although #838 doesn't touch this line). I'm happy to rebase if your bullet-addition lands first though.

Mapped to `allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page.
If `allowedAddress` has not been specified, then they can use any IP address on the associated physical interface for the network resource.
Otherwise, when allowedAddress is specified, the container cannot use IP addresses that are not in the allowedAddress list for the physical address.
Mapped to `allowed-address` in the [zonecfg(1M)][zonecfg.1m_2] man page.
* **`configureAllowedAddress`** *(string, OPTIONAL)* If configureAllowedAddress is set to true, the addresses specified by allowedAddress are automatically configured on the interface each time the container starts.
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're backticking allowdAddress (like you do a few lines above), you probably want to get it (and configureAllowedAddress?) here too. Or we can punt some/all of the backtick fixup to a follow-up PR.

config.md Outdated

* **`type`** (string, REQUIRED) - the platform resource being limited, for example on Linux as defined in the [setrlimit(2)][setrlimit.2] man page.
* **`soft`** (uint64, REQUIRED) - the value of the limit enforced for the corresponding resource.
* **`hard`** (uint64, REQUIRED) - the ceiling for the soft limit that could be set by an unprivileged process. Only a privileged process (e.g. under Linux: one with the CAP_SYS_RESOURCE capability) can raise a hard limit.
* **`hard`** (uint64, REQUIRED) - the ceiling for the soft limit that could be set by an unprivileged process.
Only a privileged process (e.g. under Linux: one with the CAP_SYS_RESOURCE capability) can raise a hard limit.
Copy link
Contributor

Choose a reason for hiding this comment

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

You want more indents here to place this line under the hard list entry.

@Mashimiao
Copy link
Author

@wking @TomSweeneyRedHat all comments have been fixed.

config.md Outdated

If defined, a directory MUST exist at the path declared by the field.
* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false. On Windows, this field must be omitted or false.
* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false.
* On Windows, this field must be omitted or false.
Copy link
Contributor

Choose a reason for hiding this comment

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

This line will need at least a “must” → “MUST”, but this PR is already touching so much that I'd rather leave that fix to a follow-up PR.

@Mashimiao Mashimiao force-pushed the format-specs branch 2 times, most recently from 746b721 to b4f31ee Compare May 24, 2017 05:33
@Mashimiao
Copy link
Author

Mashimiao commented May 24, 2017

ping @opencontainers/runtime-spec-maintainers
If this PR looks OK, can you let it in as soon as possible?
As the PR modifies several files, if not, I think I have to rebase many times.

* **`utilityvmpath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. This would be specified if using a base image which does not contain a utility VM image. If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path.
* **`utilityvmpath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM.
This would be specified if using a base image which does not contain a utility VM image.
If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path.

* **`sandboxpath`** *(string, REQUIRED)* - specifies the root of the path to the sandbox to be used for the container.

Choose a reason for hiding this comment

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

Looks like https://github.com/opencontainers/runtime-spec/pull/849/files is getting ready to remove this, you might have some merge fun between the two PR's.

Copy link

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the touch ups.

@vbatts
Copy link
Member

vbatts commented May 31, 2017

needs a rebase, but LGTM

Ma Shimiao added 2 commits June 1, 2017 10:08
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
@Mashimiao
Copy link
Author

@vbatts @mrunalp rebased

@vbatts
Copy link
Member

vbatts commented Jun 1, 2017

LGTM

Approved with PullApprove

1 similar comment
@tianon
Copy link
Member

tianon commented Jun 1, 2017

LGTM

Approved with PullApprove

@vbatts vbatts mentioned this pull request Jul 5, 2017
@wking wking mentioned this pull request Sep 11, 2017
wking added a commit to wking/oci-project-template that referenced this pull request Apr 6, 2018
The Markdown spec is liberal for the first paragraph [1]:

> To make lists look nice, you can wrap items with hanging
> indents... But if you want to be lazy, you don’t have to...

However, it's a bit more strict about subsequent paragraphs [1]:

> List items may consist of multiple paragraphs. Each subsequent
> paragraph in a list item must be indented by either 4 spaces or one
> tab:

That doesn't matter for our use here, because all of our entries are
single-paragraph.  But runtime-spec has been bitten by Pandoc
strictness for multiple paragraphs before [2], and their RELEASES.md
has used four-space indents since [3].  By adopting the stricter
behavior here, we make it easier for OCI Projects to stay synchronized
with the template while maintaining their stricter local conventions.
OCI Projects that do not have strict local conventions probably don't
care either way.

[1]: https://daringfireball.net/projects/markdown/syntax#list
[2]: opencontainers/runtime-spec#495
[3]: opencontainers/runtime-spec#846

Signed-off-by: W. Trevor King <wking@tremily.us>
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