Skip to content

Commit 95bfb25

Browse files
committed
update documentation, comments
1 parent 2877255 commit 95bfb25

File tree

6 files changed

+95
-63
lines changed

6 files changed

+95
-63
lines changed

README.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,11 @@ outputs. aws-api uses the same data descriptions to expose a
3434
data-oriented interface, using service descriptions, documentation,
3535
and specs which are generated from the source descriptions.
3636

37-
Most AWS SDKs have their own copies of these data descriptions in their
38-
github repos. We use [aws-sdk-js](https://github.com/aws/aws-sdk-js/) as
39-
the source for these, and release separate artifacts for each api.
40-
The [api descriptors](https://github.com/aws/aws-sdk-js/tree/master/apis)
41-
include the AWS `api-version` in their filenames (and in their data). For
42-
example you'll see both of the following files listed:
43-
44-
dynamodb-2011-12-05.normal.json
45-
dynamodb-2012-08-10.normal.json
46-
47-
Whenever we release com.cognitect.aws/dynamodb, we look for the
48-
descriptor with the most recent API version. If aws-sdk-js-v2.351.0
49-
contains an update to dynamodb-2012-08-10.normal.json, or a new
50-
dynamodb descriptor with a more recent api-version, we'll make a
51-
release whose version number includes the 2.351.0 from the version
52-
of aws-sdk-js.
53-
54-
We also include the revision of our generator in the version. For example,
55-
`com.cognitect.aws/dynamo-db-653.2.351.0` indicates revision `653` of the
56-
generator, and tag `v2.351.0` of aws-sdk-js.
57-
58-
* See [Versioning](/doc/versioning.md) for more about how we version releases.
37+
Most AWS SDKs have their own copies of these data descriptions in their github
38+
repos. We use [aws-sdk-java-2](https://github.com/aws/aws-sdk-java-v2) as the
39+
source for these, and release separate artifacts for each api.
40+
41+
* See [Versioning](/doc/versioning.md) for more info about how we version releases.
5942
* See [latest releases](latest-releases.edn) for a list of the latest releases of
6043
`api`, `endpoints`, and all supported services.
6144

@@ -471,7 +454,7 @@ operation requires a custom endpoint, e.g.
471454

472455
This indicates that the data in the `com.cognitect.aws/endpoints` lib
473456
(which is derived from
474-
[endpoints.json](https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/resources/com/amazonaws/partitions/endpoints.json))
457+
[endpoints.json](https://github.com/aws/aws-sdk-java-v2/blob/master/core/regions/src/main/resources/software/amazon/awssdk/regions/internal/region/endpoints.json))
475458
does not support the `:api`/`:region` combination you are trying to
476459
access.
477460

doc/versioning.md

Lines changed: 76 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,48 @@
22

33
To use aws-api in your application, you depend on
44
`com.cognitect.aws/api`, `com.cognitect.aws/endpoints` and
5-
`com.cognitect.aws/<service>`, e.g. `com.cognitect.aws/s3`. `api`, `endpoints`,
6-
and `<service>`
7-
all have different release schedules and version semantics.
5+
`com.cognitect.aws/<service>`, e.g. `com.cognitect.aws/s3`.
86

97
## Version semantics
108

9+
The artifacts fall into one of three categories:
10+
11+
* `com.cognitect.aws/api`
12+
* `com.cognitect.aws/endpoints`
13+
* each `<service>` artifact (of which there are hundreds)
14+
15+
Each of these three categories of artifacts are capable of being released and versioned independently.
16+
1117
## com.cognitect.aws/api
1218

1319
0.8.[rev]
1420

1521
`rev` is the revision in the git repository.
1622

17-
## com.cognitect.aws/endpoints
23+
## endpoints and services
24+
25+
[major-rev].[source.repo.tag]
26+
27+
Starting with release `871.2.29.35`, `endpoints` and service artifact versions are being prefixed
28+
with the same major version prefix, currently `871`. The `2.29.35` is a tag in the AWS SDK source
29+
repository, currently [AWS SDK Java v2](https://github.com/aws/aws-sdk-java-v2), from which both
30+
`endpoints` and service artifacts are generated.
31+
32+
These artifacts are released independently and sporadically, only as needed - a given artifact will
33+
only see a new release if the current tag of the AWS SDK source repository contains changes for that
34+
artifact, or if a new service descriptor is discovered which has not yet been released.
35+
36+
Prior to release `871.2.29.35`, `endpoints` and services had different major version prefixes. This
37+
is because they were generated from different, older AWS SDK repositories: [aws-sdk-java
38+
v1](https://github.com/aws/aws-sdk-java) and [aws-sdk-js](https://github.com/aws/aws-sdk-js),
39+
respectively. With the deprecation of both of those repositories, it was necessary to migrate to the
40+
current Java v2 repository and to release new versions of all artifacts, which was release
41+
`871.2.29.35`.
42+
43+
The following two sections provides more detail and historical context about `endpoints` and service
44+
artifacts, respectively.
45+
46+
### com.cognitect.aws/endpoints
1847

1948
[source-rev].[source.repo.tag]
2049

@@ -37,20 +66,23 @@ we'll add a row to this table.
3766

3867
[generator-rev].[source.repo.tag]
3968

40-
`generator-rev` indicates the revision of the code we use to
41-
generate all the services and `source.repo.tag` is the tag in the aws
69+
`source-rev` indicates which aws-sdk (or other resource) we are
70+
generating from and `source.repo.tag` is the tag in the aws
4271
repository from which we are generating service libraries. For example,
4372
`s3-631.2.347.0` is sourced from [aws-sdk-js](https://github.com/aws/aws-sdk-js),
4473
per the table below, at the `2.347.0` tag.
4574

46-
| generator-rev | source repository | example source tag | example service version |
47-
|---------------|-------------------|--------------------|-------------------------|
48-
| >= 871 | aws-sdk-java-v2 | 2.29.35 | 871.2.29.35 |
49-
| >= 631 | aws-sdk-js | v2.347.0 | 631.2.347.0 |
75+
| source-rev | source repository | example source tag | example service version |
76+
|------------|-------------------|--------------------|-------------------------|
77+
| >= 871 | aws-sdk-java-v2 | 2.29.35 | 871.2.29.35 |
78+
| >= 631 | aws-sdk-js | v2.347.0 | 631.2.347.0 |
5079

5180
If we start to source services from a different repository,
5281
we'll add a row to this table.
5382

83+
Prior to source revision `871`, the source revision was linked to the version of the code used to
84+
generate the service artifacts. Beginning with revision `871` that is no longer true.
85+
5486
## Release schedules
5587

5688
### com.cognitect.aws/api
@@ -64,24 +96,42 @@ their release schedules.
6496
### com.cognitect.aws/endpoints
6597

6698
This is generated from source data in an aws github repository, so we
67-
periodically check to see if there are any new release tags in the
68-
source repo. When there are, we diff the endpoint resource at the
69-
first new tag with the last released tag. If there is a diff, we
70-
cut a release at that new tag, and then do the same thing, comparing
71-
the next new tag to the last released tag, until we run out of new
72-
tags.
73-
74-
For example, if the last version we released is `1.1.11.444`, we look
75-
to see if there are any tags newer than `1.11.444` in the source
76-
repo. If we find e.g. `1.11.445`, `1.11.446`, and `1.11.447`, we'll
77-
diff `1.11.445` against `1.11.444`. If the endpoints resource changed,
78-
we'll cut a `1.1.11.445` release and then continue, comparing
79-
`1.1.446` to `1.1.445`, and so on.
80-
81-
If there is no difference, we move to the next tag (`1.1.446`) and
82-
compare it to our last-released basis (`1.1.444`), and so on.
99+
periodically check to see if there are any changes to the endpoints resource at
100+
the repository's latest tag, since the last released tag. If there is a diff, we
101+
cut a release at that new tag.
102+
103+
For example, if the last version we released is `871.1.11.444`, and the
104+
repository's most recent tag is `1.11.678`, we'll diff `1.11.445` against
105+
`1.11.678`. If the endpoints resource changed, we'll cut a `871.1.11.678`
106+
release.
83107

84108
### com.cognitect.aws/&lt;service>
85109

86110
This works just like `endpoints`, above, except that we do the same
87111
thing for every aws service available in the source repository.
112+
113+
114+
## Service API Versions
115+
116+
The api descriptors include the AWS `api-version` in their `:metadata`. If, for
117+
any given service, the AWS SDK repository contains descriptors for more than one
118+
api version, only the most recent api version will have an artifact generated
119+
and released.
120+
121+
As of this writing, the [AWS SDK Java
122+
v2](https://github.com/aws/aws-sdk-java-v2) repository has no such examples of
123+
this. But if and when it does, this policy will continue to hold true.
124+
125+
For example: historically, services were generated from the
126+
[aws-sdk-js](https://github.com/aws/aws-sdk-js) repository, which contains at
127+
least one instance of this situation. In that repository you'll find both of
128+
the following files:
129+
130+
dynamodb-2011-12-05.normal.json
131+
dynamodb-2012-08-10.normal.json
132+
133+
In that case, whenever we released `com.cognitect.aws/dynamodb`, we look for the
134+
descriptor with the most recent API version. If `aws-sdk-js-v2.351.0` contains
135+
an update to `dynamodb-2012-08-10.normal.json`, or a new dynamodb descriptor
136+
with a more recent api-version, we'd make a release whose version number
137+
includes the `2.351.0` from the version of aws-sdk-js.

src/cognitect/aws/signers.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
(.isEmpty encoded-path)
8282
"/"
8383

84-
;; https://github.com/aws/aws-sdk-java/blob/fd409de/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AbstractAWSSigner.java#L392-L397
84+
;; https://github.com/aws/aws-sdk-java-v2/blob/61d16e0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAws4Signer.java#L546-L555
8585
;; Normalization can leave a trailing slash at the end of the resource path,
8686
;; even if the input path doesn't end with one. Example input: /foo/bar/.
8787
;; Remove the trailing slash if the input path doesn't end with one.

src/cognitect/aws/util.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
[^String s]
208208
(-> s
209209
(URLEncoder/encode "UTF-8")
210-
;; https://github.com/aws/aws-sdk-java/blob/fd409de/aws-java-sdk-core/src/main/java/com/amazonaws/util/SdkHttpUtils.java#L77-L91
210+
;; https://github.com/aws/aws-sdk-java-v2/blob/61d16e0/utils/src/main/java/software/amazon/awssdk/utils/http/SdkHttpUtils.java#L170-L176
211211
(.replace "+" "%20")
212212
(.replace "*" "%2A")))
213213

test/src/cognitect/aws/client/shared_test.clj

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
(testing "Creating a client with custom attributes does not deref the default delayed shared resources."
1010
;; As a precondition of this test, the delays must be unrealized.
1111
(require 'cognitect.aws.client.shared :reload)
12-
(do
13-
(aws/client {:api :s3
14-
:http-client (reify http/HttpClient)
15-
:region-provider :test-provider
16-
:credentials-provider :test-provider})
17-
(is (not (realized? @#'shared/shared-http-client)))
18-
(is (not (realized? @#'shared/shared-region-provider)))
19-
(is (not (realized? @#'shared/shared-credentials-provider))))))
12+
(aws/client {:api :s3
13+
:http-client (reify http/HttpClient)
14+
:region-provider :test-provider
15+
:credentials-provider :test-provider})
16+
(is (not (realized? @#'shared/shared-http-client)))
17+
(is (not (realized? @#'shared/shared-region-provider)))
18+
(is (not (realized? @#'shared/shared-credentials-provider)))))

test/src/cognitect/aws/generators.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
query-ks (gen/vector (gen/such-that seq gen/string-alphanumeric))
2626
query-vs (gen/vector (gen/such-that seq gen/string-alphanumeric) (count query-ks))
2727
method (gen/elements [:get :post])
28-
;; https://github.com/aws/aws-sdk-java/blob/d35b018/aws-java-sdk-core/src/main/java/com/amazonaws/auth/internal/SignerKey.java#L30-L34
29-
;; date must be >1 day past epoch and <= today
30-
;; 1668999574880 == 2022-11-20
31-
epoch (gen/large-integer* {:min 86400000 :max 1668999574880})
28+
;; https://github.com/aws/aws-sdk-java-v2/blob/61d16e0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/SignerKey.java#L44
29+
;; date will be >1 day past epoch and <= today
30+
;; 1735838904634 == 2025-01-02
31+
epoch (gen/large-integer* {:min 86400000 :max 1735838904634})
3232
body gen/string]
3333
{:request-method method
3434
:body (.getBytes ^String body "UTF-8")

0 commit comments

Comments
 (0)