awsdocs / aws-doc-sdk-examples

Welcome to the AWS Code Examples Repository. This repo contains code examples used in the AWS documentation, AWS SDK Developer Guides, and more. For more information, see the Readme.md file below.
Apache License 2.0
9.52k stars 5.62k forks source link

TASK: Make the SOS data easier to munch on #2598

Closed indrora closed 2 years ago

indrora commented 2 years ago

Currently, each service's SOS data is in one giant file. This means that there's a good risk of merge conflicts and there's even more chances for things to go wrong.

The SOS metadata should be split up into a few smaller chunks.

Suggestion:

  1. Move the data out of .doc_gen
  2. Make each service/language folder have the metadata for that service/language
  3. Make it possible to auto-extract the snippets and "fill in the gaps"

so for SQS in Javav2, you'd have javav2/sqs/snippets.yml, for SNS in dotnet v3 it'd be dotnetv3/sns/snippets.yml

Laren-AWS commented 2 years ago

I don't think we should do this.

brmur commented 2 years ago

@indrora I agree with Laren that we'd be complicating the process (& adding work) to split the metadata. However, I'll poll the team to establish whether merge conflicts merit the changes you're proposing.

indrora commented 2 years ago

My observations so far:

as for "where do the titles come from", here's a draft of my suggestion:

metadata/ebs.yml would look like

ebs_StartSnapshot:
  title: Create a &EBS; snapshot using an &AWS; SDK
  title_abbrev: Create a snapshot
  synopsis: create an &EBS; snapshot.
  category: []
  services:
    ebs: {StartSnapshot}

rust/ebs/snippets.yml would look like

ebs_StartSnapshot:
  - sdk_version: 1
     github: rust/ebs
     tag: ebs.rust.create-snapshot-start

meanwhile, this might be more complicated in another language:

ruby/ebs/snippets.yml

ebs_StartSnapshot:
  - sdk_version: 1
     github: ruby/ebs
     body:
       - tag: ebs.ruby.create-snapshot-start
         before: Start the &EBS; volume snapshot
       - tag: ebs.ruby.create-snapshot-wait
         before: In order to make sure further &EBS; operations work right, you must wait for the state to change to READY
         after: The &EBS; snapshot is now in progress and you can continue working with the volume.

as for automatically associating these snippets, the Rust example I gave could easily be simply declared inline:

//snippet-start[ebs.rust.create-snapshot-start]
//snippet-group[ebs_CreateSnapshot]
...
//snippet-end[ebs.rust.create-snapshot-start]
Laren-AWS commented 2 years ago

I need more data on "major" and "horrendous".

Your proposed format change:

Extra tag in code: