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

Env var documentation mismatch #2715

Open
VannTen opened this issue Sep 23, 2022 · 1 comment
Open

Env var documentation mismatch #2715

VannTen opened this issue Sep 23, 2022 · 1 comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance.

Comments

@VannTen
Copy link
Member

VannTen commented Sep 23, 2022

The documentation does not match the code:

README.rst:

...
1. Configure environment variables

   .. list-table::
      :widths: 25 25
      :header-rows: 1

      * - Variable name
        - Content
      * - ``S3_ENDPOINT_URL``
        - Ceph Host name
      * - ``CEPH_BUCKET``
        - Ceph Bucket name
      * - ``CEPH_BUCKET_PREFIX``
        - Ceph Prefix
      * - ``CEPH_KEY_ID``
        - Ceph Key ID
      * - ``CEPH_SECRET_KEY``
        - Ceph Secret Key

   .. code-block:: python

       from thoth.storages.ceph import CephStore
       ceph = CephStore()

thoth/storages/ceph.py:

class CephStore(StorageBase):
    """Adapter for storing and retrieving data from Ceph - low level API."""

    def __init__(
        self,
        prefix,
        *,
        host: str = None,
        key_id: str = None,
        secret_key: str = None,
        bucket: str = None,
        region: str = None,
    ):
        """Initialize adapter to Ceph.

        Parameters not explicitly provided will be picked from env variables.
        """
        super().__init__()
        self.host = host or os.environ["THOTH_S3_ENDPOINT_URL"]
        self.key_id = key_id or os.environ["THOTH_CEPH_KEY_ID"]
        self.secret_key = secret_key or os.environ["THOTH_CEPH_SECRET_KEY"]
        self.bucket = bucket or os.environ["THOTH_CEPH_BUCKET"]
        self.region = region or os.getenv("THOTH_CEPH_REGION", None)
        self._s3 = None
        self.prefix = prefix

/kind documentation
/sig stack-guidance
/priority backlog
/good-first-issue

We should decide if we keep the THOTH_ env prefix or not, and adjust
accordingly. Opinions ?

@sesheta
Copy link
Member

sesheta commented Sep 23, 2022

@VannTen:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

The documentation does not match the code:

README.rst:

...
1. Configure environment variables

  .. list-table::
     :widths: 25 25
     :header-rows: 1

     * - Variable name
       - Content
     * - ``S3_ENDPOINT_URL``
       - Ceph Host name
     * - ``CEPH_BUCKET``
       - Ceph Bucket name
     * - ``CEPH_BUCKET_PREFIX``
       - Ceph Prefix
     * - ``CEPH_KEY_ID``
       - Ceph Key ID
     * - ``CEPH_SECRET_KEY``
       - Ceph Secret Key

  .. code-block:: python

      from thoth.storages.ceph import CephStore
      ceph = CephStore()

thoth/storages/ceph.py:

class CephStore(StorageBase):
   """Adapter for storing and retrieving data from Ceph - low level API."""

   def __init__(
       self,
       prefix,
       *,
       host: str = None,
       key_id: str = None,
       secret_key: str = None,
       bucket: str = None,
       region: str = None,
   ):
       """Initialize adapter to Ceph.

       Parameters not explicitly provided will be picked from env variables.
       """
       super().__init__()
       self.host = host or os.environ["THOTH_S3_ENDPOINT_URL"]
       self.key_id = key_id or os.environ["THOTH_CEPH_KEY_ID"]
       self.secret_key = secret_key or os.environ["THOTH_CEPH_SECRET_KEY"]
       self.bucket = bucket or os.environ["THOTH_CEPH_BUCKET"]
       self.region = region or os.getenv("THOTH_CEPH_REGION", None)
       self._s3 = None
       self.prefix = prefix

/kind documentation
/sig stack-guidance
/priority backlog
/good-first-issue

We should decide if we keep the THOTH_ env prefix or not, and adjust
accordingly. Opinions ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sesheta sesheta added kind/documentation Categorizes issue or PR as related to documentation. sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. priority/backlog Higher priority than priority/awaiting-more-evidence. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Sep 23, 2022
@harshad16 harshad16 moved this to 🆕 New in Planning Board Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/stack-guidance Categorizes an issue or PR as relevant to SIG Stack Guidance.
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants